<!DOCTYPE html><html lang="en">
      
      
        
    
    
    
    

      
      
      <head>
        <meta charset="utf-8">
        <meta name="format-detection" content="telephone=no">  
        
        <title>Lecture 4: Number Theory I | Video Lectures | Mathematics for Computer Science | Electrical Engineering and Computer Science | MIT OpenCourseWare</title>
    <!-- Begin Automatic Metadata Insertion -->
    <meta content="6-042j-mathematics-for-computer-science-fall-2010" name="WT.cg_n">
    <meta content="Lecture 4: Number Theory I" name="WT.cg_s">
    <meta content="Explores the basics of number theory with state machines, linear combinations, and algorithms for computation with integers." name="Description">
    <meta content="Leighton, Tom" name="Author">
    <meta content="Dijk, Marten van " name="Author">
    <meta content="6.042J,6.042,18.062J,18.062,number theory,divisibility,state machine,induction,linear combination,Euclid's algorithm,pulverizer,greatest common divsor,Computer Science,Probability and Statistics,Applied Mathematics,Discrete Mathematics" name="keywords">
    <meta content="6.042J Mathematics for Computer Science | Lecture 4: Number Theory I" name="Search_Display">
    <meta content="Computer Science" itemprop="about">
    <meta content="Probability and Statistics" itemprop="about">
    <meta content="Applied Mathematics" itemprop="about">
    <meta content="Discrete Mathematics" itemprop="about">
    <!-- End Automatic Metadata Insertion -->

	<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/grid.css">
<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/base.css">
<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/menu.css">
<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/jquery.bubblepopup.css">
<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/search.css">
<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/courses.css">
<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/courses_new.css">
<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/jquery.jscrollpane.css">
<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/media_tabs.css">
	<link href="../../../common/xml/ocwcc.rdf" type="application/rdf+xml" rel="metadata">
	<link rel="canonical" href="https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-fall-2010/video-lectures/lecture-4-number-theory-i/">
	<link rel="apple-touch-icon" href="../../../common/images/apple-touch-icon.png">
	
	
      
	
	<script type="text/javascript" src="../../../common/scripts/jquery.js"></script>
	<script type="text/javascript" src="../../../common/scripts/ocw-media-utils-offline.js"></script>
	<script type="text/javascript" src="../../../common/scripts/ocw-offline.js"></script>
	<script type="text/javascript" src="../../../common/scripts/jquery.bubblepopup.min.js"></script>
	<script type="text/javascript" src="../../../common/scripts/jquery-ui.min.js"></script>
	<script type="text/javascript" src="../../../common/scripts/jquery.jscrollpane.min.js"></script>
	<script type="text/javascript" src="../../../common/scripts/expandy.js"></script>
	<script type="text/javascript" src="../../../common/scripts/bubble-popup-offline.js"></script>
	
	
	
    <script type="text/javascript">
      $(document).ready(function() {
        $("#tabs").tabs();
        IpadScroller();
      });
    </script>
    
    
    
    
    
    
      
       
		 

        
        
        

        
        
        
        
        
        
        
        
        
      </head>
    <body itemscope itemtype="http://schema.org/WebPage">
        
	

        <header id="top">
			<div id="grid">
				
				
					
<div id="portletwrapper-6f63772e746f70706f72746c65746d616e616765720a636f6e746578740a2f506c6f6e650a736974652d686561646572" class="portletWrapper kssattr-portlethash-6f63772e746f70706f72746c65746d616e616765720a636f6e746578740a2f506c6f6e650a736974652d686561646572">
<div class="portletStaticText portlet-static-site-header">
<!--googleoff: index-->
<div class="grid_6 alpha" id="banner"><a href="https://ocw.mit.edu/"><img src="../../../common/images/ocw_mast.png" class="logo" alt="MIT OpenCourseWare, Massachusetts Institute of Technology"></a></div>
<div class="grid_6 omega" id="subscribe">
<aside class="module" aria-label="Connect with OCW">
<table class="social">
    <tbody>
        <tr>
            <td class="socialbutton"><a aria-label="Subscribe to the OCW Newsletter" href="https://ocw.mit.edu/subscribe/index.htm?utm_source=header"><img src="../../../common/images/trans.gif" alt="An icon depicting an envelope.">Subscribe to the OCW Newsletter</a></td>
            <td>
<a aria-label="Facebook" href="https://facebook.com/mitocw"><img src="../../../common/images/icon_fb.png" alt="Click to visit our Facebook page."></a>  <a aria-label="Instagram" href="https://www.instagram.com/mitocw/"><img src="https://ocw.mit.edu/images/icon_ig.png" alt="Click to visit our Instagram page."></a> <a aria-label="Twitter" href="https://twitter.com/mitocw"><img src="https://ocw.mit.edu/images/icon_twitter.png" alt="Click to visit our Twitter feed."></a><a aria-label="YouTube" href="https://www.youtube.com/mitocw" style="font-size: 12.208px;"><img src="https://ocw.mit.edu/images/icon_yt.png" alt="Click to visit our YouTube page."></a><span style="font-size: 12.208px;">   </span><a aria-label="Open Matters blog on WordPress" href="https://www.ocw-openmatters.org/" style="font-size: 12.208px;"><img src="https://ocw.mit.edu/images/icon_wp.png" alt="Click to visit our blog on WordPress."></a>
</td>
        </tr>
    </tbody>
</table>
</aside><nav aria-label="Help Links" class="helplinks">     <a aria-label="OCW Site Help" href="https://ocw.mit.edu/help">Help</a><span aria-hidden="true">|</span>     <a href="../../../common/about/contactus.htm">Contact Us</a>   </nav>
</div>
<div class="clear"> </div>
<!--googleon: index-->
</div>

</div>

<div id="portletwrapper-6f63772e746f70706f72746c65746d616e616765720a636f6e746578740a2f506c6f6e650a6d6567612d6d656e75" class="portletWrapper kssattr-portlethash-6f63772e746f70706f72746c65746d616e616765720a636f6e746578740a2f506c6f6e650a6d6567612d6d656e75">
<div class="portletStaticText portlet-static-mega-menu"><div><nav id="mega" class="grid_8 alpha" aria-label="Site">
<ul id="menu" role="presentation">
    <li id="menu_home">
<a href="https://ocw.mit.edu/" aria-label="Homepage"><img src="../../../common/images/top-nav_home.png" class="home_icon" alt="Click for site home page."></a><!-- Begin Home Item -->
</li>
    <!-- End Home Item -->
    <li id="drop_1" aria-label="Find Courses">
<a href="#" aria-hidden="true">FIND COURSES</a><!-- Begin 5 columns Item -->
    <div class="dropdown_5columns-a mega-courses">
    <div class="col_1a">
    <div class="row_1a">
<nav aria-labelledby="mm-find-courses-by">     <span id="mm-find-courses-by" class="nav" aria-hidden="true">Find courses by:</span>
    <ul class="find_by" role="presentation">
        <li><a href="https://ocw.mit.edu/courses/find-by-topic/">Topic</a></li>
        <li><a href="https://ocw.mit.edu/courses/find-by-number/">MIT Course Number</a></li>
        <li><a href="https://ocw.mit.edu/courses/find-by-department/">Department</a></li>
    </ul>
    </nav>     <nav aria-labelledby="mm-collections">     <span id="mm-collections" class="nav" aria-hidden="true">Collections</span>
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/courses/new-courses/">New Courses</a></li>
        <li><a href="https://ocw.mit.edu/courses/most-visited-courses/">Most Visited Courses</a></li>
        <li><a href="https://ocw.mit.edu/courses/ocw-scholar/">OCW Scholar Courses</a></li>
        <li><a href="https://ocw.mit.edu/courses/audio-video-courses/">Audio/Video Lectures</a></li>
        <li><a href="https://ocw.mit.edu/courses/online-textbooks/">Online Textbooks</a></li>
        <li><a href="https://ocw.mit.edu/resources/">Supplemental Resources</a></li>
        <li><a href="https://ocw.mit.edu/high-school/">OCW Highlights for High School</a></li>
        <li><a href="https://ocw.mit.edu/courses/mitx-related-courseware/">MITx &amp; Related OCW Courses</a></li>
        <li><a href="https://ocw.mit.edu/courses/mit-open-learning-library/">MIT Open Learning Library</a></li>
    </ul>
    </nav>     <nav class="col_1b" aria-labelledby="mm-translated-courses">     <span id="mm-translated-courses" class="nav" aria-hidden="true" style="line-height: 1.3;">Cross-Disciplinary Topic Lists</span>
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/courses/energy-courses">Energy</a></li>
        <li><a href="https://ocw.mit.edu/courses/entrepreneurship">Entrepreneurship</a></li>
        <li><a href="https://ocw.mit.edu/courses/environment-courses">Environment</a></li>
        <li><a href="https://ocw.mit.edu/courses/intro-programming">Introductory Programming</a></li>
        <li><a href="https://ocw.mit.edu/courses/life-sciences">Life Sciences</a></li>
        <li><a href="https://ocw.mit.edu/courses/transportation-courses">Transportation</a></li>
    </ul>
    </nav>
</div>
    <div class="row_1b"><nav aria-labelledby="mm-cross-disciplinary-topic-lists">     <span id="mm-cross-disciplinary-topic-lists" class="nav" aria-hidden="true">Translated Courses</span>
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/courses/translated-courses/traditional-chinese" aria-label="Traditional Chinese">繁體字 / Traditional Chinese</a></li>
        <li><a href="https://ocw.mit.edu/courses/translated-courses/turkish" aria-label="Turkish">Türkçe / Turkish</a></li>
        <li><a href="https://ocw.mit.edu/courses/translated-courses/korean" aria-label="Korean">(비디오)한국 / Korean</a></li>
    </ul>
    </nav></div>
    </div>
    </div>
    </li>
    <li id="drop_2">
<a href="#" aria-label="For Educators">For Educators</a>
    <div class="dropdown_1column-a" style="width: 270px;"><nav aria-labelledby="mm-find-courses-by">
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/educator/chalk-radio-podcast">Chalk Radio Podcast</a></li>
        <li><a href="https://ocw.mit.edu/educator/">OCW Educator Portal</a></li>
    </ul>
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/courses/instructor-insights/">Instructor Insights by Department</a></li>
        <li><a href="https://openlearning.mit.edu/campus/digital-innovations/">Residential Digital Innovations </a></li>
    </ul>
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/high-school/">OCW Highlights for High School</a></li>
    </ul>
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/educator/additional-resources/">Additional Resources</a></li>
    </ul>
    </nav></div>
    </li>
    <li id="drop_3">
<a href="#" aria-hidden="true">Give Now</a>
    <div class="dropdown_1column-a"><nav class="col_1" aria-label="Donate">
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/give/">Make a Donation</a></li>
        <li><a href="https://ocw.mit.edu/give/why-give/">Why Give?</a></li>
        <li><a href="https://ocw.mit.edu/give/our-supporters/">Our Supporters</a></li>
        <li><a href="https://ocw.mit.edu/give/other-ways-to-contribute/">Other Ways to Contribute</a></li>
        <li><a href="https://ocw.mit.edu/support/">Become a Corporate Sponsor</a></li>
    </ul>
    </nav></div>
    </li>
    <li id="drop_4">
<a href="#" aria-hidden="true">About</a>
    <div class="dropdown_1column-a"><nav class="col_1" aria-label="About">
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/about/">About MIT OpenCourseWare</a></li>
        <li><a href="https://ocw.mit.edu/about/site-statistics/">Site Statistics</a></li>
        <li><a href="https://ocw.mit.edu/about/ocw-stories/">OCW Stories</a></li>
        <li><a href="https://ocw.mit.edu/about/newsletter/">Newsletter</a></li>
        <li><a href="https://chalk-radio.simplecast.com/">Chalk Radio Podcast</a></li>
        <li><a href="https://www.ocw-openmatters.org/">Open Matters Blog</a></li>
    </ul>
    </nav></div>
    </li>
</ul>
</nav></div></div>

</div>





<!--googleoff: index-->
<script>
  (function() {
	var cx = '012626166551961672889:owjdpuboktq';
	var gcse = document.createElement('script');
	gcse.type = 'text/javascript';
	gcse.async = true;
	gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
	var s = document.getElementsByTagName('script')[0];
	s.parentNode.insertBefore(gcse, s);
  })();
  window.onload = function(){
	document.getElementById('gsc-i-id1').placeholder = 'Search';	
  };

$(document).ready(function(){

$('.advanceSearch a').keydown(function(event){showSearchTips($(this),event);})
$('#searchTipsModal').keydown(function(event){showSearchTips($(this),event);})

function showSearchTips(obj,evt) {
// if pressed enter key
	if ( evt.which == 13 || evt.which == 32) {
		showModal();
		ga('send', 'pageview', "AdvanceSearch");
		$(".advanceSearch a").attr('aria-expanded', 'true');
		$('.searchTipsModal').focus();
		evt.preventDefault();
		}
	if ( evt.which == 27 ) {
		hideModal();
		$(".advanceSearch a").attr('aria-expanded', 'false');
		var modal = document.getElementById('searchTipsModal');
		modal.style.display = "none";
		$(".advanceSearch a").focus();
		evt.preventDefault();
		}
}

});
function showModal(){
	var modal = document.getElementById('searchTipsModal');
	modal.style.display = "block";
	ga('send', 'pageview', "AdvanceSearch");
	document.getElementById("searchTipsBtn").setAttribute("aria-expanded", true);
	window.setTimeout(function () {
    document.getElementById('searchTipsModal').focus(); }, 0);
}

function hideModal(){
	var modal = document.getElementById('searchTipsModal');
	modal.style.display = "none";
	document.getElementById("searchTipsBtn").setAttribute("aria-expanded", false);
}
</script>
<div id="search" role="search" class="grid_4 omega">
    	<table class="search">
				<tbody>
					<tr>
						<td><div class="searchboxheader"><searchbox-only resultsurl="/search/ocwsearch.htm"></searchbox-only></div></td>
						<td>
							<div class="advanceSearch">
								<a id="searchTipsBtn" onclick="showModal();" href="#" role="button" aria-label="search tips" aria-expanded="false" aria-describedby="searchtips">Search Tips</a>

								<!-- The Modal -->
								<div id="searchTipsModal" class="modal" tabindex="-1">
								  <!-- Modal content -->
									<div class="modal-content">
										<div class="modal-body">
											<button class="close" onclick="hideModal();" aria-label="close">X</button>
											<span>
												<b>Exclude words from your search</b>
												<br>Put - in front of a word you want to leave out. For example, jaguar speed -car
												<br><br>
												<b>Search for an exact match</b>
												<br>Put a word or phrase inside quotes. For example, "tallest building".
												<br><br>
												<b>Search for wildcards or unknown words</b>
												<br>Put a * in your word or phrase where you want to leave a placeholder. For example, "largest * in the world".
												<br><br>
												<b>Search within a range of numbers</b>
												<br>Put .. between two numbers. For example, camera $50..$100.
												<br><br>
												<b>Combine searches</b>
												<br>Put "OR" between each search query. For example,  marathon OR race.
												<br><br>
											</span>
										</div>
								  </div>
								</div>
							</div>
						</td>
					</tr>
				</tbody>
		</table>
</div>
<div class="clear"></div>
<!--googleon: index-->
<!-- *end header* -->

				
				
			</div>
<!-- top grid end -->
		</header><!-- top end -->
			
		<div id="center_media">
      	<div id="grid">
      		<div id="left">
        		<nav id="breadcrumb_media" aria-label="Breadcrumb">
                	<p>

    <a href="https://ocw.mit.edu/">Home</a>
    
        »
        
    
    
        
            <a href="https://ocw.mit.edu/courses">Courses</a>
            
                »
                
            
            
         
    
    
        
            <a href="https://ocw.mit.edu/courses/electrical-engineering-and-computer-science">Electrical Engineering and Computer Science</a>
            
                »
                
            
            
         
    
    
        
            <a href="../../../contents/index.htm">Mathematics for Computer Science</a>
            
                »
                
            
            
         
    
    
        
            <a href="../../../contents/video-lectures/index.htm">Video Lectures</a>
            
                »
                
            
            
         
    
    
        
            
            
            Lecture 4: Number Theory I
         
    
</p>

            	</nav>
            	<div class="clear"></div>
        		<div id="media_title">
        		<h1 class="title" itemprop="name" property="dct:title">
        <span class="" id="parent-fieldname-title">
            Lecture 4: Number Theory I
        </span>
    </h1>
        		</div>
           		<div class="clear"></div>
           		<div id="course_wrapper_media">
           			<nav id="course_nav" aria-label="Course">
           				<script language="javascript" type="text/javascript">
function toggleMenu(objID) {
  if (!document.getElementById) return;
  var ob = document.getElementById(objID);
  ob.className = (ob.className == 'selected')?'': 'selected';
}
function toggleClass(id)
{
  var divtoggleClass= document.getElementById(id);
  divtoggleClass.className = (divtoggleClass.className == 'mO')?'mC': 'mO';
  return false;
}
function changeAlt(id)
{
  id.alt = (id.alt == 'Expand Menu')?'Collapse Menu' : 'Expand Menu';
  id.title = (id.title == 'Expand Menu')?'Collapse Menu' : 'Expand Menu';
}
</script>
<!--Left Nav Starts -->


	<ul>			  
	
	    	
	    	    <li class="">
			   			<a href="../../../contents/index.htm">
		                  Course Home  			                
	                    </a>
		        </li>
		    
         	
	
	
	    	
	    	    <li class="">
			   			<a href="../../../contents/syllabus/index.htm">
		                  Syllabus  			                
	                    </a>
		        </li>
		    
         	
	
	
	    	
	    	    <li class="">
			   			<a href="../../../contents/calendar/index.htm">
		                  Calendar  			                
	                    </a>
		        </li>
		    
         	
	
	
	    	
	    	    <li class="">
			   			<a href="../../../contents/readings/index.htm">
		                  Readings  			                
	                    </a>
		        </li>
		    
         	
	
	
	    	
	    	    <li class="selected">
			   			<a href="../../../contents/video-lectures/index.htm">
		                  Video Lectures  			                
	                    </a>
		        </li>
		    
         	
	
	
	    	
	    	    <li class="">
			   			<a href="../../../contents/recitations/index.htm">
		                  Recitations  			                
	                    </a>
		        </li>
		    
         	
	
	
	    	
	    	    <li class="">
			   			<a href="../../../contents/assignments/index.htm">
		                  Assignments  			                
	                    </a>
		        </li>
		    
         	
	
	
	    	
	    	    <li class="">
			   			<a href="../../../contents/exams/index.htm">
		                  Exams  			                
	                    </a>
		        </li>
		    
         	
	
	
	    	
	    	    
		    
         	
	<!--second tal block close-->  
	
</ul>


<!--Left Nav Ends -->





           			</nav>
           			<main id="course_inner_media" aria-labelledby="media_title">
      					 
        <div class="" id="parent-fieldname-text">
            
            
        </div>
    
      					     
    
    



<script type="text/javascript">var caption_embed_1 ={'English - US': '/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-fall-2010/video-lectures/lecture-4-number-theory-i/NuY7szYSXSw.srt'}</script>     
     <div id="media-embed">
         <div class="attention_message" id="embed_1">
<p>Flash and JavaScript are required for this feature.</p>
<p>Download the video from <a href="http://itunes.apple.com/us/itunes-u/lecture-4-number-theory-i/id503873536?i=110644966">iTunes U</a> or the <a href="http://www.archive.org/download/MIT6.042JF10/MIT6_042JF10_lec04_300k.mp4">Internet Archive</a>.</p>
</div>
     </div>
    
     <script type="text/javascript">ocw_embed_chapter_media('embed_1', 'https://www.youtube.com/v/NuY7szYSXSw', 'youtube', '/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-fall-2010/video-lectures/lecture-4-number-theory-i', 'https://img.youtube.com/vi/NuY7szYSXSw/0.jpg',0,0, 'https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-fall-2010/video-lectures/lecture-4-number-theory-i/NuY7szYSXSw.srt')</script>
	 
	 
	 		
	 		<div id="transcript1"></div>
				 <script type="text/javascript">createThreePlayParams(2, 781475, "embed_1", 0, 0)</script>
			 
	

     <div id="media_resource_next_prev_nav" style="margin-top: 1em;">
        <p>
        
            <a href="../../../contents/video-lectures/lecture-3-strong-induction/index.htm">
                <img src="../../../common/images/btn_previous_resource.png" style="margin: 0 30px 0 50px;" alt="Previous track" title="Previous track"></a>
     	
     	
        
            <a href="../../../contents/video-lectures/lecture-5-number-theory-ii/index.htm"> 
                <img src="../../../common/images/btn_next_resource.png" alt="Next track" title="Next track"></a>
       
       </p>
     </div>
 


<script type="text/javascript">
		window.onload=function(){
		init();
		
		}
		var tabLinks = new Array();
		var contentDivs = new Array();
		function init() {
		  // Grab the tab links and content divs from the page
		  var tabListItems = document.getElementById('tabs').childNodes;
		  for ( var i = 0; i < tabListItems.length; i++ ) {
			if ( tabListItems[i].nodeName == "LI" ) {
			  var tabLink = getFirstChildWithTagName( tabListItems[i], 'A' );
			  var id = getHash( tabLink.getAttribute('href') );
			  tabLinks[id] = tabLink;
			  contentDivs[id] = document.getElementById( id );
			}
		  }
		  // Assign onclick events to the tab links, and
		  // highlight the first tab
		  var i = 0;
		  for ( var id in tabLinks ) {
			tabLinks[id].onclick = showTab;
			tabLinks[id].onfocus = function() { this.blur() };
			if ( i == 0 ) tabLinks[id].className = 'selected';
			i++;
		  }
		  // Hide all content divs except the first
		  var i = 0;
		  for ( var id in contentDivs ) {
			if ( i != 0 ) contentDivs[id].className = 'tabContent hide';
			i++;
		  }
		}
		function showTab() {
		  var selectedId = getHash( this.getAttribute('href') );
		  // Highlight the selected tab, and dim all others.
		  // Also show the selected content div, and hide all others.
		  for ( var id in contentDivs ) {
			if ( id == selectedId ) {
			  tabLinks[id].className = 'selected';
			  contentDivs[id].className = 'tabContent';
			} else {
			  tabLinks[id].className = '';
			  contentDivs[id].className = 'tabContent hide';
			}
		  }
		  // Stop the browser following the link
		  return false;
		}
		function getFirstChildWithTagName( element, tagName ) {
		  for ( var i = 0; i < element.childNodes.length; i++ ) {
			if ( element.childNodes[i].nodeName == tagName ) return element.childNodes[i];
		  }
		}
		function getHash( url ) {
		  var hashPos = url.lastIndexOf ( '#' );
		  return url.substring( hashPos + 1 );
		}
 </script>	
 

  <div id="media_tabs">
     
        <ul id="tabs">
            <li class="first">
                <a href="#vid_about" class="selected">About this Video</a>
            </li>
            <li class="">
                <a href="#vid_index" class="">Playlist</a>
            </li>
            <li class="">
                <a href="#vid_playlist" class="">Transcript</a>
            </li>
            <li class="">
                <a href="#vid_related" class="">Download this Video</a>
            </li>
        </ul>
   
        <div id="vid_about" itemprop="description" class="tabContent">
<p><strong>Description:</strong> Explores the basics of number theory with state machines, linear combinations, and algorithms for computation with integers.</p> <p><strong>Speaker:</strong> Marten van Dijk</p>
</div>
        <div id="vid_index" itemprop="description" class="tabContent hide">
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-1-introduction-and-proofs/index.htm">
<img src="https://img.youtube.com/vi/L3LMbpZIKhQ/default.jpg" title="Lecture 1: Introduction and Proofs" alt="Lecture 1: Introduction and Proofs">
<p>Lecture 1: Introduction and...</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-2-induction/index.htm">
<img src="https://img.youtube.com/vi/z8HKWUWS-lA/default.jpg" title="Lecture 2: Induction" alt="Lecture 2: Induction">
<p>Lecture 2: Induction</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-3-strong-induction/index.htm">
<img src="https://img.youtube.com/vi/NuGDkmwEObM/default.jpg" title="Lecture 3: Strong Induction" alt="Lecture 3: Strong Induction">
<p>Lecture 3: Strong Induction</p></a>
</div>
<div class="related-media-thumbnail-nolink">
<div class="now-playing-resource">Now Playing</div>
<img src="https://img.youtube.com/vi/NuY7szYSXSw/default.jpg" title="Lecture 4: Number Theory I" alt="Lecture 4: Number Theory I">
<p>Lecture 4: Number Theory I</p>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-5-number-theory-ii/index.htm">
<img src="https://img.youtube.com/vi/XX7ePR21Ook/default.jpg" title="Lecture 5: Number Theory II" alt="Lecture 5: Number Theory II">
<p>Lecture 5: Number Theory II</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-6-graph-theory-and-coloring/index.htm">
<img src="https://img.youtube.com/vi/h9wxtqoa1jY/default.jpg" title="Lecture 6: Graph Theory and Coloring" alt="Lecture 6: Graph Theory and Coloring">
<p>Lecture 6: Graph Theory and...</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-7-matching-problems/index.htm">
<img src="https://img.youtube.com/vi/5RSMLgy06Ew/default.jpg" title="Lecture 7: Matching Problems" alt="Lecture 7: Matching Problems">
<p>Lecture 7: Matching Problems</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-8-graph-theory-ii-minimum-spanning-trees/index.htm">
<img src="https://img.youtube.com/vi/GJpt_3ie4WU/default.jpg" title="Lecture 8: Graph Theory II: Minimum Spanning Trees" alt="Lecture 8: Graph Theory II: Minimum Spanning Trees">
<p>Lecture 8: Graph Theory II:...</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-9-communication-networks/index.htm">
<img src="https://img.youtube.com/vi/bTyxpoi2dmM/default.jpg" title="Lecture 9: Communication Networks" alt="Lecture 9: Communication Networks">
<p>Lecture 9: Communication Ne...</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-10-graph-theory-iii/index.htm">
<img src="https://img.youtube.com/vi/DOIp5D7VMS4/default.jpg" title="Lecture 10: Graph Theory III" alt="Lecture 10: Graph Theory III">
<p>Lecture 10: Graph Theory III</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-11-relations-partial-orders-and-scheduling/index.htm">
<img src="https://img.youtube.com/vi/1nScXLQAQ9A/default.jpg" title="Lecture 11: Relations, Partial Orders, and Scheduling" alt="Lecture 11: Relations, Partial Orders, and Scheduling">
<p>Lecture 11: Relations, Part...</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-12-sums/index.htm">
<img src="https://img.youtube.com/vi/fAeShezAGLE/default.jpg" title="Lecture 12: Sums" alt="Lecture 12: Sums">
<p>Lecture 12: Sums</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-13-sums-and-asymptotics/index.htm">
<img src="https://img.youtube.com/vi/X9eErxRjQEI/default.jpg" title="Lecture 13: Sums and Asymptotics" alt="Lecture 13: Sums and Asymptotics">
<p>Lecture 13: Sums and Asympt...</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-14-divide-and-conquer-recurrences/index.htm">
<img src="https://img.youtube.com/vi/Kqf0uO0oV6s/default.jpg" title="Lecture 14: Divide and Conquer Recurrences" alt="Lecture 14: Divide and Conquer Recurrences">
<p>Lecture 14: Divide and Conq...</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-15-linear-recurrences/index.htm">
<img src="https://img.youtube.com/vi/TWBB-JlmYUc/default.jpg" title="Lecture 15: Linear Recurrences" alt="Lecture 15: Linear Recurrences">
<p>Lecture 15: Linear Recurrences</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-16-counting-rules-i/index.htm">
<img src="https://img.youtube.com/vi/pNt5Ll6hGqo/default.jpg" title="Lecture 16: Counting Rules I" alt="Lecture 16: Counting Rules I">
<p>Lecture 16: Counting Rules I</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-17-counting-rules-ii/index.htm">
<img src="https://img.youtube.com/vi/09yIb3VHhMI/default.jpg" title="Lecture 17: Counting Rules II" alt="Lecture 17: Counting Rules II">
<p>Lecture 17: Counting Rules II</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-18-probability-introduction/index.htm">
<img src="https://img.youtube.com/vi/SmFwFdESMHI/default.jpg" title="Lecture 18: Probability Introduction" alt="Lecture 18: Probability Introduction">
<p>Lecture 18: Probability Int...</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-19-conditional-probability/index.htm">
<img src="https://img.youtube.com/vi/E6FbvM-FGZ8/default.jpg" title="Lecture 19: Conditional Probability" alt="Lecture 19: Conditional Probability">
<p>Lecture 19: Conditional Pro...</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-20-independence/index.htm">
<img src="https://img.youtube.com/vi/l1BCv3qqW4A/default.jpg" title="Lecture 20: Independence" alt="Lecture 20: Independence">
<p>Lecture 20: Independence</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-21-random-variables/index.htm">
<img src="https://img.youtube.com/vi/MOfhhFaQdjw/default.jpg" title="Lecture 21: Random Variables" alt="Lecture 21: Random Variables">
<p>Lecture 21: Random Variables</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-22-expectation-i/index.htm">
<img src="https://img.youtube.com/vi/gGlMSe7uEkA/default.jpg" title="Lecture 22: Expectation I" alt="Lecture 22: Expectation I">
<p>Lecture 22: Expectation I</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-23-expectation-ii/index.htm">
<img src="https://img.youtube.com/vi/oI9fMUqgfxY/default.jpg" title="Lecture 23: Expectation II" alt="Lecture 23: Expectation II">
<p>Lecture 23: Expectation II</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-24-large-deviations/index.htm">
<img src="https://img.youtube.com/vi/q4mwO2qS2z4/default.jpg" title="Lecture 24: Large Deviations" alt="Lecture 24: Large Deviations">
<p>Lecture 24: Large Deviations</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-25-random-walks/index.htm">
<img src="https://img.youtube.com/vi/56iFMY8QW2k/default.jpg" title="Lecture 25: Random Walks" alt="Lecture 25: Random Walks">
<p>Lecture 25: Random Walks</p></a>
</div>
</div>
        <div id="vid_playlist" itemprop="description" class="tabContent hide">
<ul><li><a class="transcript-link" title="Open in a new window." alt="Open in a new window." style="text-decoration: none; font-size: 1.0em;" target="_blank" text-decoration: none font-size: href="../../../contents/video-lectures/lecture-4-number-theory-i/NuY7szYSXSw.pdf"> Download English-US transcript (PDF)</a></li></ul>
<p><span m="540">The</span> <span m="670">following</span> <span m="1110">content</span> <span m="1700">is</span> <span m="1820">provided</span> <span m="2260">under</span> <span m="2540">a</span> <span m="2580">Creative</span> <span m="2990">Commons</span> <span m="3390">license.</span> <span m="4500">Your</span> <span m="4690">support</span> <span m="5190">will</span> <span m="5350">help</span> <span m="5590">MIT</span> <span m="6050">OpenCourseWare</span> <span m="6840">continue</span> <span m="7350">to</span> <span m="7430">offer</span> <span m="7840">high</span> <span m="8080">quality</span> <span m="8600">educational</span> <span m="9230">resources</span> <span m="9850">for</span> <span m="10000">free.</span> <span m="11210">To</span> <span m="11220">make</span> <span m="11420">a</span> <span m="11460">donation,</span> <span m="12150">or</span> <span m="12420">view</span> <span m="12860">additional</span> <span m="13280">materials</span> <span m="13820">from</span> <span m="13970">hundreds</span> <span m="14400">of</span> <span m="14510">MIT</span> <span m="14940">courses,</span> <span m="16050">visit</span> <span m="16270">MIT</span> <span m="16690">OpenCourseWare</span> <span m="17740">at</span> <span m="17900">ocw.mit.edu.</span> </p>
<p></p>
<p><span m="23310">PROFESSOR: So</span> <span m="23540">welcome</span> <span m="23870">to</span> <span m="24020">this</span> <span m="24250">week.</span> <span m="26490">We are</span> <span m="26600">going</span> <span m="26760">to</span> <span m="26920">talk</span> <span m="27150">about</span> <span m="27390">number</span> <span m="27610">theory.</span> <span m="28980">Actually,</span> <span m="29330">before</span> <span m="29650">I</span> <span m="29690">forget,</span> <span m="30270">there</span> <span m="30460">are</span> <span m="30560">some</span> <span m="30740">handouts</span> <span m="31240">at</span> <span m="31320">the</span> <span m="31380">very</span> <span m="31660">back.</span> <span m="32450">Please</span> <span m="32830">raise</span> <span m="33060">you</span> <span m="33210">hand</span> <span m="33620">if</span> <span m="33730">you</span> <span m="33810">don't</span> <span m="34030">have</span> <span m="34290">any,</span> <span m="34990">then</span> <span m="35160">one</span> <span m="35320">of</span> <span m="35490">us</span> <span m="35670">can</span> <span m="35870">actually</span> <span m="36170">come</span> <span m="36360">over</span> <span m="36690">and</span> <span m="37620">hand you out</span> <span m="38780">this</span> <span m="38950">sheet,</span> <span m="39910">which</span> <span m="40110">contain</span> <span m="40480">some</span> <span m="40650">facts</span> <span m="41070">about</span> <span m="41520">the</span> <span m="41820">visibility.</span> <span m="43900">Thanks</span> <span m="44170">a</span> <span m="44440">lot.</span> <span m="45824">And</span> <span m="47246">we</span> <span m="47720">will</span> <span m="47960">be</span> <span m="48060">using</span> <span m="48390">these</span> <span m="48610">throughout</span> <span m="48930">the</span> <span m="49010">lecture.</span> </p>
<p><span m="50780">So</span> <span m="50960">today</span> <span m="51220">we're going</span> <span m="51540">to</span> <span m="51610">talk</span> <span m="51820">about</span> <span m="52020">number</span> <span m="52290">theory.</span> <span m="53330">And</span> <span m="53940">this</span> <span m="54110">is a</span> <span m="54270">really</span> <span m="54690">different</span> <span m="55050">way</span> <span m="55240">of</span> <span m="55390">thinking,</span> <span m="55790">actually.</span> <span m="56420">But</span> <span m="56550">we will</span> <span m="56810">use</span> <span m="57120">the</span> <span m="57190">same</span> <span m="57450">concepts</span> <span m="58170">as</span> <span m="58260">you</span> <span m="58390">have</span> <span m="58560">learned</span> <span m="58840">before,</span> <span m="59430">like</span> <span m="59690">induction,</span> <span m="60310">and</span> <span m="60570">invariance,</span> <span m="61280">stuff</span> <span m="61540">like</span> <span m="61730">that,</span> <span m="62420">to</span> <span m="62620">prove</span> <span m="62940">whole theorems.</span> <span m="64379">So</span> <span m="64550">what is number</span> <span m="64885">theory?</span> </p>
<p></p>
<p><span m="69070">Well,</span> <span m="69220">first</span> <span m="69520">of</span> <span m="69620">all,</span> <span m="69840">it's</span> <span m="70020">a</span> <span m="70080">very old</span> <span m="70660">science.</span> <span m="72050">One</span> <span m="72220">of</span> <span m="72320">the</span> <span m="72400">oldest</span> <span m="72820">mathematical</span> <span m="73390">disciplines.</span> <span m="74940">And</span> <span m="75790">only</span> <span m="76080">recently</span> <span m="77090">it</span> <span m="77250">actually</span> <span m="78570">got</span> <span m="79340">to</span> <span m="79490">have</span> <span m="79680">some</span> <span m="79810">more</span> <span m="79990">practical</span> <span m="80460">applications.</span> <span m="81480">So</span> <span m="81650">what</span> <span m="81780">this</span> <span m="81910">number</span> <span m="82130">theory--</span> <span m="83450">it's</span> <span m="83630">actually</span> <span m="83950">the</span> <span m="84100">study</span> <span m="85800">of</span> <span m="87780">the integers.</span> <span m="91580">And</span> <span m="91770">what</span> <span m="91920">are</span> <span m="92010">the</span> <span m="92120">integers?</span> <span m="93160">Well,</span> <span m="93310">these</span> <span m="93510">are</span> <span m="93580">the</span> <span m="93670">numbers</span> <span m="93980">0,</span> <span m="94430">1,</span> <span m="94980">2</span> <span m="95570">3,</span> <span m="96390">and</span> <span m="96580">so</span> <span m="96820">on.</span> <span m="98950">So</span> <span m="99530">number</span> <span m="99630">theory</span> <span m="100070">got--</span> <span m="101260">Oh,</span> <span m="101420">there's</span> <span m="101710">some more</span> <span m="101960">over here.</span> <span m="104460">Another</span> <span m="104720">handout</span> <span m="105130">over there.</span> </p>
<p></p>
<p><span m="108530">So</span> <span m="108940">number</span> <span m="109010">theory</span> <span m="110110">got</span> <span m="111440">used</span> <span m="111990">actually</span> <span m="112440">in</span> <span m="112560">cryptography</span> <span m="113870">only</span> <span m="114170">about</span> <span m="114860">40</span> <span m="115150">years</span> <span m="115410">ago.</span> <span m="116890">And</span> <span m="117570">at</span> <span m="117940">the</span> <span m="118040">end</span> <span m="118220">of</span> <span m="118330">the</span> <span m="118420">second</span> <span m="118820">lecture,</span> <span m="119880">we</span> <span m="119930">will</span> <span m="120050">be</span> <span m="120180">talking</span> <span m="120600">about</span> <span m="121580">this</span> <span m="121750">application</span> <span m="122410">into</span> <span m="122520">cryptography.</span> <span m="123150">There</span> <span m="123280">are many</span> <span m="123520">application</span> <span m="124260">in</span> <span m="124990">cryptography.</span> <span m="125970">But</span> <span m="126140">we'll</span> <span m="126330">be</span> <span m="126460">talking</span> <span m="126760">about</span> <span m="126970">one</span> <span m="127460">of them to</span> <span m="127820">show</span> <span m="128100">you</span> <span m="128560">how</span> <span m="129259">useful</span> <span m="129669">this</span> <span m="129880">actually</span> <span m="130180">is.</span> </p>
<p><span m="130500">Now</span> <span m="131470">cryptography</span> <span m="132330">is</span> <span m="132930">the</span> <span m="133010">study</span> <span m="133810">and</span> <span m="134580">practice</span> <span m="135190">of</span> <span m="135300">hiding</span> <span m="135670">numbers.</span> <span m="136110">So you</span> <span m="136230">can</span> <span m="136360">imagine</span> <span m="136680">how</span> <span m="136800">important</span> <span m="137190">that</span> <span m="137300">is.</span> <span m="139230">We</span> <span m="139480">have</span> <span m="140250">like</span> <span m="140650">medical</span> <span m="141040">data</span> <span m="141550">that</span> <span m="141940">we</span> <span m="142730">need</span> <span m="143090">to</span> <span m="143400">store</span> <span m="144370">outside</span> <span m="144920">in</span> <span m="144990">the</span> <span m="145100">cloud.</span> <span m="145480">Right?</span> <span m="145860">So,</span> <span m="146580">gee.</span> <span m="147500">Do</span> <span m="148010">we</span> <span m="148200">really</span> <span m="148440">want</span> <span m="148720">that?</span> <span m="149490">We</span> <span m="149610">actually</span> <span m="149920">want</span> <span m="150120">to</span> <span m="150240">hide</span> <span m="150620">our</span> <span m="151060">information.</span> <span m="153200">We</span> <span m="153310">do</span> <span m="153410">not</span> <span m="153630">want</span> <span m="154050">others</span> <span m="154660">who are</span> <span m="154860">not</span> <span m="155680">allowed</span> <span m="156060">to</span> <span m="156160">see</span> <span m="156590">my</span> <span m="156890">private</span> <span m="157350">information</span> <span m="158030">to</span> <span m="158130">see</span> <span m="158390">it.</span> <span m="159030">So</span> <span m="159390">this</span> <span m="159620">art</span> <span m="159900">of</span> <span m="160010">hiding</span> <span m="160320">information</span> <span m="160850">is</span> <span m="161550">extremely</span> <span m="162110">important,</span> <span m="162710">especially</span> <span m="163100">nowadays.</span> <span m="164080">And number</span> <span m="164460">theory</span> <span m="164950">actually</span> <span m="165270">will</span> <span m="165410">help</span> <span m="165680">us</span> <span m="165960">with this.</span> </p>
<p><span m="167020">So</span> <span m="167280">number</span> <span m="167550">theory</span> <span m="170080">is</span> <span m="170600">something,</span> <span m="171120">you'll</span> <span m="171400">be</span> <span m="171480">very</span> <span m="171710">surprised,</span> <span m="172530">that</span> <span m="172720">can</span> <span m="172820">be</span> <span m="172940">used</span> <span m="173430">to</span> <span m="175770">save--</span> <span m="176680">oops.</span> <span m="177520">I have</span> <span m="178010">to</span> <span m="178500">put this on.</span> <span m="180110">To</span> <span m="180240">save</span> <span m="180560">New</span> <span m="180680">York</span> <span m="180920">City</span> <span m="181590">in</span> <span m="181930">the</span> <span m="182210"><i>Die Hard</i></span> <span m="182940">number</span> <span m="183500">3,</span> <span m="183850">I</span> <span m="183930">believe.</span> <span m="184550">So</span> <span m="184970">let me</span> <span m="185700">start up again.</span> </p>
<p></p>
<p><span m="196400">So</span> <span m="196610">let's</span> <span m="196810">see</span> <span m="196910">where</span> <span m="197090">it</span> <span m="197200">plays.</span> </p>
<p></p>
<p><span m="200780">Maybe not.</span> </p>
<p><span m="202265">[VIDEO PLAYBACK]</span> </p>
<p><span m="205240">-Yeah,</span> <span m="205510">go</span> <span m="205810">ahead</span> <span m="205950">and grab</span> <span m="206090">it.</span> </p>
<p><span m="207193">-You're the cop.</span> </p>
<p><span m="208140">-Simon</span> <span m="208560">said</span> <span m="208600">you're</span> <span m="208870">supposed to</span> <span m="209100">be</span> <span m="209210">helping</span> <span m="209510">with</span> <span m="209640">this.</span> </p>
<p><span m="209980">-I'm helping.</span> </p>
<p><span m="210930">-Well, when</span> <span m="211150">you</span> <span m="211290">going to</span> <span m="211540">start helping?</span> </p>
<p><span m="212350">-After you</span> <span m="212550">get</span> <span m="212720">the</span> <span m="212800">bomb.</span> </p>
<p></p>
<p><span m="231740">Careful.</span> </p>
<p><span m="233220">-You be careful.</span> </p>
<p><span m="234000">-Don't open</span> <span m="234570">it.</span> </p>
<p><span m="235040">-What?</span> <span m="236100">I</span> <span m="236180">got to</span> <span m="236340">open</span> <span m="236640">it.</span> <span m="237620">And</span> <span m="237960">it's</span> <span m="238210">going</span> <span m="238290">to</span> <span m="238330">be</span> <span m="238530">all right.</span> </p>
<p></p>
<p><span m="248790">[BEEPING]</span> </p>
<p><span m="250284">[ELECTRONIC CHIRPING]</span> </p>
<p><span m="251778">Shit.</span> </p>
<p><span m="253280">-Shit!</span> <span m="253690">I told you</span> <span m="253830">not</span> <span m="254100">to</span> <span m="254480">open</span> <span m="254670">it.</span> </p>
<p><span m="255421">[PHONE RINGING]</span> </p>
<p><span m="256834">[PHONE RINGING]</span> </p>
<p></p>
<p><span m="259660">-I</span> <span m="259790">thought you'd</span> <span m="260100">see</span> <span m="260523">the</span> <span m="260946">message.</span> <span m="262215">It</span> <span m="262640">has</span> <span m="262730">a proximity</span> <span m="263120">circuit,</span> <span m="263510">so please</span> <span m="263690">don't</span> <span m="263940">run.</span> </p>
<p><span m="265380">-Yeah,</span> <span m="265640">I</span> <span m="265920">got</span> <span m="266180">it.</span> <span m="266240">We're</span> <span m="266320">not</span> <span m="266470">going</span> <span m="266560">to</span> <span m="266620">run.</span> <span m="267100">How do we</span> <span m="267552">turn this thing</span> <span m="268004">off?</span> </p>
<p><span m="268908">-On the front</span> <span m="269360">there</span> <span m="269812">should be</span> <span m="270270">two jugs.</span> <span m="270830">Do you see them?</span> <span m="272270">A</span> <span m="272580">give</span> <span m="273050">gallon,</span> <span m="273240">and a three</span> <span m="273380">gallon.</span> <span m="274850">Fill</span> <span m="275220">on</span> <span m="275480">of the</span> <span m="275620">jugs</span> <span m="276220">with</span> <span m="276450">exactly</span> <span m="276990">four</span> <span m="277370">gallons</span> <span m="277750">of water</span> <span m="278510">and</span> <span m="278890">place</span> <span m="279310">it on</span> <span m="279550">the</span> <span m="279680">scale,</span> <span m="280460">and</span> <span m="280540">the</span> <span m="280660">timer</span> <span m="280960">will</span> <span m="281280">stop.</span> <span m="281880">You</span> <span m="282315">must</span> <span m="282750">be</span> <span m="283010">precise.</span> <span m="283970">One</span> <span m="284260">ounce</span> <span m="284470">or</span> <span m="284780">lower</span> <span m="285100">less</span> <span m="285410">will result</span> <span m="285520">in</span> <span m="285950">demolition.</span> <span m="286920">If</span> <span m="287180">you're</span> <span m="287330">still</span> <span m="287690">alive</span> <span m="288080">in</span> <span m="288320">five</span> <span m="288460">minutes,</span> <span m="288900">we'll</span> <span m="289000">speak again.</span> </p>
<p><span m="289405">-Wait! Wait</span> <span m="289810">a</span> <span m="290270">sec.</span> </p>
<p></p>
<p><span m="294410">I</span> <span m="294870">don't</span> <span m="295030">get it.</span> <span m="295390">You get</span> <span m="295550">it?</span> </p>
<p><span m="295930">-No.</span> </p>
<p></p>
<p><span m="299070">-Get</span> <span m="299190">the</span> <span m="299290">jugs.</span> </p>
<p></p>
<p><span m="302410">Obviously,</span> <span m="302850">we</span> <span m="302970">can't</span> <span m="303350">fill</span> <span m="303630">the</span> <span m="303690">three</span> <span m="303880">gallon</span> <span m="304140">jug</span> <span m="304360">will</span> <span m="304490">four</span> <span m="304980">gallons of</span> <span m="305090">water,</span> <span m="305320">right?</span> </p>
<p><span m="306096">-Obviously.</span> </p>
<p><span m="307090">-I know. There</span> <span m="307240">we</span> <span m="307320">go.</span> <span m="308610">We fill</span> <span m="308790">the</span> <span m="308880">three</span> <span m="309090">gallon</span> <span m="309360">jug</span> <span m="309660">exactly</span> <span m="310090">to</span> <span m="310180">the</span> <span m="310280">top,</span> <span m="310570">right?</span> </p>
<p><span m="311275">-Uh-huh.</span> </p>
<p><span m="311710">-OK. Now</span> <span m="312140">we pour</span> <span m="312400">that</span> <span m="312660">three</span> <span m="312810">gallons</span> <span m="313250">into</span> <span m="313470">the</span> <span m="313550">five</span> <span m="313900">gallon</span> <span m="314130">jugs,</span> <span m="314760">giving</span> <span m="314860">us</span> <span m="315080">exactly</span> <span m="315590">3</span> <span m="315850">gallons</span> <span m="316200">in the</span> <span m="316340">five</span> <span m="316620">gallon</span> <span m="316880">jug,</span> <span m="317150">right?</span> </p>
<p><span m="317415">-Right.</span> <span m="317680">Then what?</span> </p>
<p><span m="318640">-Now,</span> <span m="319410">we</span> <span m="319870">take the three gallon</span> <span m="320220">jug,</span> <span m="320860">fill it a</span> <span m="321210">third</span> <span m="321630">of the way up--</span> </p>
<p><span m="322090">-No, no. He</span> <span m="322240">said</span> <span m="322480">be</span> <span m="322970">precise.</span> <span m="323190">Exactly</span> <span m="323510">four gallons.</span> </p>
<p><span m="323830">-Every cop</span> <span m="324040">in</span> <span m="324330">50</span> <span m="324540">miles</span> <span m="324740">is running</span> <span m="324910">his</span> <span m="325100">ass</span> <span m="325190">off,</span> <span m="325510">and I'm</span> <span m="325780">out</span> <span m="326030">here</span> <span m="326210">playing</span> <span m="326380">kids</span> <span m="326480">games</span> <span m="326770">in</span> <span m="327050">a</span> <span m="327120">park.</span> </p>
<p><span m="327970">-Hey.</span> <span m="329950">You</span> <span m="330080">want</span> <span m="330270">to</span> <span m="330310">focus</span> <span m="330780">on</span> <span m="330910">the</span> <span m="330980">problem</span> <span m="331430">at</span> <span m="331600">hand?</span> </p>
<p><span m="331820">[END PLAYBACK]</span> </p>
<p><span m="332740">[LAUGHING]</span> </p>
<p><span m="335040">PROFESSOR: All</span> <span m="335340">right.</span> <span m="336370">You</span> <span m="336520">can</span> <span m="336690">imagine</span> <span m="337130">what</span> <span m="337290">we are going</span> <span m="337690">to</span> <span m="337790">do</span> <span m="337950">right</span> <span m="338170">here,</span> <span m="338500">right?</span> <span m="339690">So.</span> <span m="342510">You</span> <span m="342630">can</span> <span m="342780">imagine</span> <span m="343100">what's</span> <span m="343270">below this</span> <span m="343620">table</span> <span m="344070">is</span> <span m="344230">a</span> <span m="344280">bomb.</span> </p>
<p><span m="345594">[LAUGHING]</span> </p>
<p><span m="347910">You</span> <span m="348060">guys</span> <span m="348360">have</span> <span m="348530">to</span> <span m="348650">save</span> <span m="348950">6042.</span> </p>
<p><span m="349610">[LAUGHING]</span> </p>
<p><span m="350940">So</span> <span m="351190">we</span> <span m="351290">have</span> <span m="351470">the</span> <span m="351570">fountain</span> <span m="352180">here.</span> <span m="352890">Each</span> <span m="353180">tennis ball</span> <span m="353510">is</span> <span m="353810">one</span> <span m="354030">gallon</span> <span m="354380">of</span> <span m="354470">water.</span> <span m="355030">We</span> <span m="355180">have</span> <span m="355390">a</span> <span m="355460">big</span> <span m="355690">jug,</span> <span m="356010">five</span> <span m="356340">gallons</span> <span m="356690">and</span> <span m="356820">three</span> <span m="357050">gallons.</span> <span m="358050">So you</span> <span m="358170">all</span> <span m="358290">got</span> <span m="358460">to</span> <span m="358560">help</span> <span m="358760">me</span> <span m="358900">out</span> <span m="359100">here.</span> <span m="360040">So</span> <span m="360400">who has</span> <span m="360570">an</span> <span m="360690">idea</span> <span m="361030">of</span> <span m="361370">what</span> <span m="361550">we</span> <span m="361630">can</span> <span m="361810">do?</span> <span m="362500">So.</span> </p>
<p></p>
<p><span m="365720">AUDIENCE: [INAUDIBLE]</span> </p>
<p><span m="367196">PROFESSOR: All right.</span> <span m="368680">Let's</span> <span m="368900">first</span> <span m="369150">do</span> <span m="369270">that.</span> <span m="369690">Fill up</span> <span m="370040">the</span> <span m="370160">three</span> <span m="370440">gallons.</span> </p>
<p><span m="371345">AUDIENCE: And pout it</span> <span m="371790">into the five.</span> </p>
<p><span m="372680">PROFESSOR: Let's</span> <span m="372900">pour it</span> <span m="373150">into</span> <span m="373350">five.</span> <span m="376170">Maybe</span> <span m="376400">someone</span> <span m="376760">else</span> <span m="377000">can--</span> <span m="377880">can</span> <span m="378050">continue.</span> <span m="379010">Over</span> <span m="379170">there.</span> </p>
<p><span m="380700">AUDIENCE: If we</span> <span m="381600">do</span> <span m="382080">the same</span> <span m="382160">again,</span> <span m="382450">we'll</span> <span m="382870">end up with</span> <span m="383080">just</span> <span m="383370">one</span> <span m="384160">gallon</span> <span m="384550">in the</span> <span m="384850">three gallon.</span> </p>
<p><span m="386276">PROFESSOR: Uh-huh.</span> <span m="386750">So,</span> <span m="387010">let's</span> <span m="387200">do</span> <span m="387290">that.</span> <span m="388670">Because</span> <span m="388950">that's</span> <span m="389180">true,</span> <span m="389440">right.</span> <span m="389530">You can</span> <span m="390520">only</span> <span m="390770">fill</span> <span m="390960">it</span> <span m="391110">up</span> <span m="391200">to</span> <span m="391270">five</span> <span m="391590">gallons.</span> <span m="392010">So</span> <span m="392360">only,</span> <span m="392760">at more,</span> <span m="393160">two</span> <span m="393360">gallons</span> <span m="393700">can</span> <span m="393880">add to</span> <span m="394180">this,</span> <span m="394680">exactly</span> <span m="395280">two</span> <span m="395440">gallons.</span> <span m="396190">And one</span> <span m="396410">gallon</span> <span m="396760">is left.</span> <span m="397780">All</span> <span m="398090">right,</span> <span m="398390">next one.</span> <span m="399148">You? Would</span> <span m="399606">you like to--</span> </p>
<p><span m="400064">AUDIENCE: Take out the</span> <span m="400522">five.</span> </p>
<p><span m="401440">PROFESSOR: Take</span> <span m="401660">out</span> <span m="401890">the</span> <span m="401960">five.</span> <span m="402520">All</span> <span m="402630">right.</span> </p>
<p></p>
<p><span m="407300">And</span> <span m="408110">then</span> <span m="408210">what?</span> </p>
<p><span m="408520">AUDIENCE: Pour the one</span> <span m="408960">over there.</span> </p>
<p><span m="409840">PROFESSOR: Pour the</span> <span m="409900">one over</span> <span m="410270">here?</span> </p>
<p></p>
<p><span m="415142">AUDIENCE: [INAUDIBLE]</span> </p>
<p><span m="417590">AUDIENCE: Then fill</span> <span m="417770">the</span> <span m="418000">three gallon,</span> <span m="418310">and</span> <span m="418620">put it into</span> <span m="419094">the five.</span> </p>
<p><span m="420042">PROFESSOR: All right.</span> <span m="421464">That's great.</span> <span m="421940">And</span> <span m="422020">I</span> <span m="422250">fill</span> <span m="422370">it up</span> <span m="422510">right here.</span> <span m="423380">Fantastic.</span> <span m="424720">So</span> <span m="424870">we</span> <span m="424950">actually</span> <span m="425210">have</span> <span m="425400">four</span> <span m="425610">gallons here.</span> <span m="427690">And</span> <span m="427970">luckily,</span> <span m="428250">they are</span> <span m="428650">safe.</span> <span m="428870">Right?</span> <span m="429230">So</span> <span m="429520">you</span> <span m="429740">say,</span> <span m="430030">thank</span> <span m="430450">god.</span> <span m="430730">6042</span> </p>
<p><span m="433370">So</span> <span m="433580">we</span> <span m="433680">can</span> <span m="433820">continue.</span> </p>
<p></p>
<p><span m="437400">So</span> <span m="437570">this</span> <span m="437860">is</span> <span m="438030">actually</span> <span m="439310">pretty</span> <span m="439640">amazing,</span> <span m="440080">though.</span> <span m="440230">How</span> <span m="440410">can</span> <span m="440580">we</span> <span m="440700">get</span> <span m="440940">four</span> <span m="441190">gallon</span> <span m="441490">out</span> <span m="441740">of</span> <span m="441900">three</span> <span m="442260">gallon</span> <span m="442520">jug,</span> <span m="442770">and</span> <span m="442850">a</span> <span m="442900">five</span> <span m="443210">gallon</span> <span m="443480">jug?</span> <span m="443750">And</span> <span m="443830">that's</span> <span m="443950">what</span> <span m="444090">we</span> <span m="444440">are</span> <span m="444580">going</span> <span m="444780">to</span> <span m="444900">talk</span> <span m="445190">about</span> <span m="446070">in</span> <span m="446210">more</span> <span m="446370">generality,</span> <span m="447060">actually.</span> <span m="448190">And</span> <span m="449570">if</span> <span m="449740">you</span> <span m="449860">would</span> <span m="450000">just</span> <span m="450290">change</span> <span m="450680">it</span> <span m="450790">a</span> <span m="450830">little</span> <span m="451160">bit,</span> <span m="451380">right?</span> <span m="452250">Then</span> <span m="453240">things</span> <span m="453530">would</span> <span m="453650">get</span> <span m="453820">more</span> <span m="453980">difficult.</span> <span m="455360">For</span> <span m="455510">example,</span> <span m="456060">if</span> <span m="456160">you</span> <span m="456290">would</span> <span m="456440">change</span> <span m="458570">the</span> <span m="458670">five</span> <span m="459050">gallon</span> <span m="459380">jug</span> <span m="459820">into</span> <span m="460110">a</span> <span m="460170">six</span> <span m="460560">gallon</span> <span m="460850">jug,</span> <span m="462080">can</span> <span m="462260">we</span> <span m="462320">still</span> <span m="462540">get</span> <span m="462740">four</span> <span m="462960">gallons?</span> <span m="464680">No.</span> <span m="464820">Why</span> <span m="464970">not?</span> </p>
<p></p>
<p><span m="467695">AUDIENCE: [INAUDIBLE]</span> </p>
<p><span m="469690">PROFESSOR: Everything</span> <span m="470150">has</span> <span m="470310">to</span> <span m="470400">be</span> <span m="470540">multiples</span> <span m="470990">of</span> <span m="471360">three.</span> <span m="471826">That's exactly</span> <span m="472520">right.</span> <span m="474410">This</span> <span m="474600">is</span> <span m="474740">a</span> <span m="474790">multiple</span> <span m="475180">of</span> <span m="475280">3.</span> <span m="475510">1</span> <span m="475690">times</span> <span m="475970">3.</span> <span m="476190">This</span> <span m="476360">is</span> <span m="476470">2</span> <span m="476670">times</span> <span m="477040">3.</span> <span m="477280">So</span> <span m="477400">if</span> <span m="477630">I</span> <span m="478060">do</span> <span m="478230">combinations</span> <span m="478930">with</span> <span m="479080">those,</span> <span m="479770">like</span> <span m="480110">pouring</span> <span m="480530">one</span> <span m="480720">into</span> <span m="480960">the</span> <span m="481110">other</span> <span m="481380">completely,</span> <span m="482060">or</span> <span m="482840">emptying,</span> <span m="483440">of</span> <span m="483550">filling</span> <span m="483860">up,</span> <span m="484290">we</span> <span m="484430">always</span> <span m="484830">will</span> <span m="484960">have</span> <span m="485350">a</span> <span m="486020">multiple</span> <span m="486620">of</span> <span m="486780">three</span> <span m="487360">gallons</span> <span m="487645">in</span> <span m="488140">either</span> <span m="488470">one</span> <span m="488640">of</span> <span m="488750">those,</span> <span m="489040">or both.</span> </p>
<p><span m="490160">So</span> <span m="490310">we</span> <span m="490440">can</span> <span m="490580">never</span> <span m="490850">have</span> <span m="491020">four</span> <span m="491290">gallons.</span> <span m="492630">So</span> <span m="492920">this</span> <span m="493170">is</span> <span m="493260">something</span> <span m="495040">that</span> <span m="495150">we</span> <span m="495290">would</span> <span m="495360">like</span> <span m="495540">to</span> <span m="495660">analyze</span> <span m="496160">a</span> <span m="496210">little</span> <span m="496370">bit</span> <span m="496520">more.</span> <span m="496960">And</span> <span m="498210">to</span> <span m="498410">do</span> <span m="498600">that,</span> <span m="498840">we're</span> <span m="498980">going</span> <span m="499200">to</span> <span m="499390">first</span> <span m="499720">a</span> <span m="499770">all</span> <span m="500420">start</span> <span m="500710">with</span> <span m="500860">a</span> <span m="500900">definition.</span> <span m="502080">Actually</span> <span m="502450">you</span> <span m="502540">can</span> <span m="503380">put</span> <span m="503530">up</span> <span m="503760">the</span> <span m="504140">screen</span> <span m="504670">over</span> <span m="504810">here.</span> <span m="508480">So</span> <span m="508820">let me</span> <span m="509060">take</span> <span m="509310">that</span> <span m="509480">out.</span> </p>
<p></p>
<p><span m="513840">Can</span> <span m="514000">someone</span> <span m="514400">up</span> <span m="514549">there</span> <span m="515530">pull up</span> <span m="515760">the</span> <span m="516049">screen?</span> <span m="517610">Maybe</span> <span m="517860">not?</span> <span m="518520">Maybe later.</span> </p>
<p><span m="520190">All</span> <span m="520340">right.</span> <span m="520840">So</span> <span m="521120">let's</span> <span m="521350">go</span> <span m="521640">with</span> <span m="521870">a</span> <span m="522039">definition.</span> </p>
<p></p>
<p><span m="528150">We</span> <span m="528280">say</span> <span m="528800">n</span> <span m="529110">denote</span> <span m="529930">by</span> <span m="530230">m</span> <span m="530580">and</span> <span m="530750">a</span> <span m="530810">bar,</span> <span m="531330">and</span> <span m="531920">a,</span> <span m="532300">we</span> <span m="532430">mean</span> <span m="533940">m</span> <span m="535470">defines</span> <span m="537030">a.</span> <span m="539340">And how</span> <span m="539540">do</span> <span m="539680">you</span> <span m="539870">define</span> <span m="540180">this?</span> <span m="540920">Well,</span> <span m="542410">we</span> <span m="542540">say</span> <span m="542830">that</span> <span m="543070">n</span> <span m="543360">defines</span> <span m="543795">a,</span> <span m="544230">if</span> <span m="544440">and</span> <span m="544580">only</span> <span m="544910">if</span> <span m="546520">there exists</span> <span m="547520">an</span> <span m="547700">integer</span> <span m="548190">k,</span> <span m="549170">such</span> <span m="549570">that</span> <span m="550750">a</span> <span m="551030">can</span> <span m="551260">be</span> <span m="551440">written</span> <span m="552350">as</span> <span m="552510">some</span> <span m="552700">multiple</span> <span m="553410">m,</span> <span m="553960">mainly</span> <span m="554670">k</span> <span m="555010">times</span> <span m="556000">m.</span> <span m="558100">So</span> <span m="559890">if</span> <span m="560060">you</span> <span m="560190">look</span> <span m="560340">at</span> <span m="560510">this</span> <span m="561590">definition</span> <span m="561980">we,</span> <span m="562370">for</span> <span m="562420">example,</span> <span m="562920">have</span> <span m="563180">that</span> <span m="563625">3 divides</span> <span m="564440">6,</span> <span m="565100">like</span> <span m="565350">what</span> <span m="565540">we</span> <span m="565680">just</span> <span m="566290">discussed.</span> <span m="567790">There's</span> <span m="567940">something</span> <span m="568270">interesting</span> <span m="568720">going</span> <span m="569040">on.</span> <span m="569270">Suppose</span> <span m="570590">a</span> <span m="570760">is</span> <span m="571000">equal</span> <span m="571200">to</span> <span m="571300">0.</span> <span m="573160">Well,</span> <span m="573710">any</span> <span m="574440">integer</span> <span m="575080">will</span> <span m="575330">define</span> <span m="575420">a,</span> <span m="577150">will</span> <span m="577260">define</span> <span m="577370">0.</span> <span m="578030">Why is</span> <span m="578370">that?</span> <span m="579030">Because</span> <span m="579570">I</span> <span m="579680">can't</span> <span m="579940">take</span> <span m="580350">k</span> <span m="580550">to</span> <span m="580650">be</span> <span m="580760">equal</span> <span m="580960">to</span> <span m="581060">0,</span> <span m="582090">so</span> <span m="582280">this is</span> <span m="582540">equal</span> <span m="582800">to</span> <span m="582880">0</span> <span m="583350">times</span> <span m="584140">any</span> <span m="584510">integer</span> <span m="584960">m.</span> <span m="585190">So</span> <span m="585530">m</span> <span m="586370">defines</span> <span m="586850">0</span> <span m="587590">for</span> <span m="587790">all</span> <span m="588020">integers.</span> <span m="588910">So</span> <span m="589050">this is</span> <span m="589480">kind</span> <span m="589680">of</span> <span m="589770">the</span> <span m="589850">exception,</span> <span m="590390">right?</span> </p>
<p><span m="591440">And</span> <span m="592460">we</span> <span m="592580">are</span> <span m="592620">going</span> <span m="592830">to</span> <span m="592960">use</span> <span m="593300">this</span> <span m="594130">to</span> <span m="595160">set</span> <span m="595500">up</span> <span m="595860">a</span> <span m="595930">theorem,</span> <span m="596840">and</span> <span m="597280">analyze</span> <span m="597850">this</span> <span m="598390">whole</span> <span m="598530">situation</span> <span m="599360">over</span> <span m="599470">here.</span> <span m="602090">Now</span> <span m="602220">in order to</span> <span m="602500">do</span> <span m="602670">that,</span> <span m="603490">we</span> <span m="603710">will</span> <span m="604080">need</span> <span m="604380">to</span> <span m="605740">sort</span> <span m="605980">of</span> <span m="607460">define</span> <span m="608310">what</span> <span m="608540">we</span> <span m="608650">can</span> <span m="608860">do</span> <span m="608990">with</span> <span m="609210">all</span> <span m="609400">this.</span> <span m="609790">So</span> <span m="611140">there</span> <span m="611390">are</span> <span m="611950">states.</span> <span m="612710">We</span> <span m="612850">will</span> <span m="612960">define</span> <span m="613280">a</span> <span m="613330">state</span> <span m="613720">machine.</span> <span m="614940">We</span> <span m="615060">will</span> <span m="615670">see</span> <span m="616280">what</span> <span m="616540">kind</span> <span m="616770">of</span> <span m="616950">possible</span> <span m="617460">transitions</span> <span m="618060">we</span> <span m="618210">can</span> <span m="618370">have.</span> <span m="619230">And</span> <span m="619650">once</span> <span m="619940">we</span> <span m="620040">have</span> <span m="620270">modeled</span> <span m="620630">all</span> <span m="620820">this</span> <span m="621040">very</span> <span m="621250">precisely,</span> <span m="622120">we</span> <span m="622230">can</span> <span m="622370">start</span> <span m="622730">proofing</span> <span m="623100">stuff.</span> </p>
<p><span m="625520">Now</span> <span m="625640">let</span> <span m="625780">me</span> <span m="625920">first</span> <span m="626190">of</span> <span m="626380">all</span> <span m="627220">write</span> <span m="627570">out</span> <span m="628070">what</span> <span m="628250">our</span> <span m="628440">assumptions</span> <span m="629060">are.</span> <span m="630970">So</span> <span m="631100">suppose</span> <span m="634290">we</span> <span m="634480">have</span> <span m="635050">an</span> <span m="636000">a</span> <span m="636230">gallon</span> <span m="636530">jug.</span> <span m="640110">So</span> <span m="640380">in</span> <span m="640490">our</span> <span m="640750">case,</span> <span m="642000">a</span> <span m="642230">equals</span> <span m="642940">3.</span> <span m="644500">And</span> <span m="644700">we</span> <span m="644810">have</span> <span m="645120">also</span> <span m="645410">b</span> <span m="645840">gallon</span> <span m="646130">jug.</span> </p>
<p></p>
<p><span m="650140">And in</span> <span m="650370">our</span> <span m="650600">case,</span> <span m="651170">b</span> <span m="651510">equals</span> <span m="651900">5,</span> <span m="652250">right?</span> <span m="653740">And</span> <span m="654070">we</span> <span m="654260">issue</span> <span m="654790">that</span> <span m="655270">a</span> <span m="655680">is</span> <span m="656140">at</span> <span m="656310">most</span> <span m="656710">b.</span> <span m="658180">That is sort</span> <span m="658720">of</span> <span m="658960">the</span> <span m="659050">situation</span> <span m="659700">that</span> <span m="659820">we are</span> <span m="659990">working</span> <span m="660330">with.</span> <span m="661380">And</span> <span m="661640">he</span> <span m="661740">would</span> <span m="661860">like</span> <span m="662040">to</span> <span m="662130">prove</span> <span m="662360">a</span> <span m="662450">theorem.</span> <span m="665220">Exactly</span> <span m="665720">what</span> <span m="665880">we</span> <span m="666000">notice</span> <span m="666420">over</span> <span m="666670">here,</span> <span m="666840">that</span> <span m="666930">three</span> <span m="667300">defines</span> <span m="667800">both.</span> <span m="668330">The</span> <span m="668450">three</span> <span m="668710">gallon</span> <span m="668990">jug,</span> <span m="669360">and</span> <span m="669550">the</span> <span m="669600">six</span> <span m="669930">gallon</span> <span m="670200">jug,</span> <span m="670580">we</span> <span m="670710">would</span> <span m="670890">like</span> <span m="671070">to</span> <span m="671190">prove</span> <span m="671450">something</span> <span m="671860">like</span> <span m="672060">this.</span> <span m="673740">If</span> <span m="674000">m</span> <span m="674160">defines a,</span> <span m="675900">and</span> <span m="676100">also</span> <span m="678470">m</span> <span m="678540">defines</span> <span m="678970">be,</span> <span m="680270">well,</span> <span m="683400">then</span> <span m="683860">m</span> <span m="684000">should</span> <span m="684510">define</span> <span m="685160">any</span> <span m="685780">results</span> <span m="686720">that</span> <span m="686900">I</span> <span m="686960">can</span> <span m="687200">get</span> <span m="689920">with</span> <span m="690280">the</span> <span m="690430">pouring,</span> <span m="690920">and</span> <span m="691630">emptying</span> <span m="692130">and</span> <span m="692220">filling</span> <span m="692670">those</span> <span m="692940">jugs.</span> <span m="694170">So</span> <span m="694320">this</span> <span m="694530">is</span> <span m="694670">the</span> <span m="694750">theorem,</span> <span m="695180">if</span> <span m="695290">you'd</span> <span m="695450">like</span> <span m="695630">to</span> <span m="695740">prove.</span> <span m="696000">And we</span> <span m="696130">can</span> <span m="696270">only</span> <span m="696470">do</span> <span m="696610">that</span> <span m="696900">if</span> <span m="697020">you</span> <span m="697090">start</span> <span m="697780">to</span> <span m="697900">have</span> <span m="698080">a</span> <span m="698140">proper</span> <span m="698460">model</span> <span m="698780">for</span> <span m="698950">this.</span> </p>
<p><span m="700380">So</span> <span m="701060">let's</span> <span m="701340">go</span> <span m="701520">for</span> <span m="701710">that.</span> <span m="703020">And--</span> </p>
<p></p>
<p><span m="707490">And,</span> <span m="708530">well,</span> <span m="709040">the</span> <span m="709130">state</span> <span m="709490">machine</span> <span m="710450">that we're</span> <span m="710750">going</span> <span m="710970">to</span> <span m="711080">use</span> <span m="711420">here</span> <span m="712570">looks</span> <span m="712820">like</span> <span m="712960">this.</span> </p>
<p></p>
<p><span m="720570">First</span> <span m="720810">of</span> <span m="720980">all,</span> <span m="722920">the</span> <span m="723030">states</span> <span m="723690">that</span> <span m="723900">we</span> <span m="724380">have</span> <span m="725060">are</span> <span m="726070">the</span> <span m="726190">number</span> <span m="726500">of</span> <span m="726950">gallons</span> <span m="727370">that</span> <span m="727430">are</span> <span m="727630">in</span> <span m="727930">these</span> <span m="728120">two</span> <span m="728270">jugs.</span> <span m="728750">So</span> <span m="729120">we</span> <span m="729230">will</span> <span m="729360">denote</span> <span m="729750">those</span> <span m="730040">by</span> <span m="730310">pairs.</span> </p>
<p></p>
<p><span m="733810">Pairs</span> <span m="734270">x,</span> <span m="734640">comma</span> <span m="734930">y.</span> <span m="736700">And</span> <span m="739120">x</span> <span m="739460">denotes</span> <span m="741340">the</span> <span m="741430">number</span> <span m="741730">of</span> <span m="741890">gallons</span> <span m="742630">in</span> <span m="743000">the</span> <span m="743210">a</span> <span m="743380">gallon</span> <span m="743680">jug.</span> <span m="746640">The</span> <span m="746730">number</span> <span m="747010">of</span> <span m="747180">gallons</span> <span m="747455">m</span> <span m="747730">m</span> <span m="750220">that we</span> <span m="750530">abbreviate</span> <span m="751070">as</span> <span m="751300">by</span> <span m="751440">the</span> <span m="751550">a</span> <span m="751780">jug,</span> <span m="753560">and</span> <span m="753910">y</span> <span m="754860">is</span> <span m="755060">the</span> <span m="755130">number</span> <span m="755390">of</span> <span m="756610">gallons</span> <span m="758860">in</span> <span m="759270">the</span> <span m="759560">b jug.</span> </p>
<p><span m="761970">So</span> <span m="762140">these</span> <span m="762400">are</span> <span m="762470">the</span> <span m="762570">states.</span> <span m="763960">And</span> <span m="765540">the start</span> <span m="765940">state</span> <span m="766560">it</span> <span m="766730">exactly</span> <span m="767230">as</span> <span m="767490">it is</span> <span m="767600">right</span> <span m="767840">there.</span> <span m="769760">We</span> <span m="769920">have</span> <span m="770160">nothing</span> <span m="770610">in</span> <span m="770730">either</span> <span m="771020">of the</span> <span m="771230">jugs.</span> </p>
<p></p>
<p><span m="775300">So</span> <span m="775580">that's</span> <span m="775820">the</span> <span m="775910">pair</span> <span m="776220">0,</span> <span m="776670">comma</span> <span m="776920">0.</span> <span m="777980">So</span> <span m="778120">now</span> <span m="778270">we</span> <span m="778410">start</span> <span m="778760">to</span> <span m="779150">build</span> <span m="779320">up</span> <span m="779420">some</span> <span m="779550">mathematics</span> <span m="780150">here,</span> <span m="780360">right?</span> <span m="780590">So</span> <span m="780790">we</span> <span m="781390">express</span> <span m="782260">the</span> <span m="782500">state</span> <span m="782960">of</span> <span m="783380">this</span> <span m="783550">whole</span> <span m="783710">situation</span> <span m="784380">by</span> <span m="784550">a pair of</span> <span m="784990">number.</span> <span m="785980">Now</span> <span m="786190">we</span> <span m="786270">need</span> <span m="786450">to</span> <span m="786540">find</span> <span m="786880">out</span> <span m="787240">what</span> <span m="787380">they</span> <span m="787480">can</span> <span m="787680">do</span> <span m="787810">with</span> <span m="788030">it.</span> <span m="789210">So</span> <span m="789330">what</span> <span m="789460">are</span> <span m="789560">the</span> <span m="789690">transitions?</span> </p>
<p></p>
<p><span m="798480">The transitions</span> <span m="799220">are,</span> <span m="799490">as</span> <span m="799650">we</span> <span m="799750">have</span> <span m="799890">seen,</span> <span m="800350">right?</span> <span m="800650">We</span> <span m="800720">can</span> <span m="800860">just</span> <span m="801120">fill</span> <span m="801960">one</span> <span m="802160">of</span> <span m="802310">the</span> <span m="802390">jugs.</span> <span m="802830">We</span> <span m="802940">can</span> <span m="803080">empty</span> <span m="803460">those.</span> <span m="804110">And</span> <span m="804290">the other</span> <span m="804560">possibility is</span> <span m="805200">that</span> <span m="805310">we</span> <span m="805380">can</span> <span m="805530">pour</span> <span m="805800">one</span> <span m="806000">jug</span> <span m="806250">over</span> <span m="806550">into</span> <span m="806680">the</span> <span m="806790">other</span> <span m="806970">one</span> <span m="807530">as</span> <span m="807700">much</span> <span m="807950">as</span> <span m="808030">we</span> <span m="808190">can.</span> <span m="809020">So</span> <span m="809210">let's</span> <span m="809430">write</span> <span m="809660">all</span> <span m="809820">of</span> <span m="809940">those</span> <span m="810230">out.</span> </p>
<p></p>
<p><span m="814320">We</span> <span m="814430">can</span> <span m="814660">do</span> <span m="815270">emptying.</span> <span m="816010">Well,</span> <span m="816450">how</span> <span m="816900">does</span> <span m="817130">that</span> <span m="817450">change</span> <span m="817765">the state?</span> </p>
<p></p>
<p><span m="820820">If</span> <span m="821010">we</span> <span m="821110">have</span> <span m="821350">x</span> <span m="821690">gallons</span> <span m="822420">in</span> <span m="823470">this</span> <span m="823710">jug,</span> <span m="823970">and</span> <span m="824100">y--</span> <span m="824850">and</span> <span m="825020">y</span> <span m="825130">gallons</span> <span m="825630">in</span> <span m="825710">that</span> <span m="825870">one,</span> <span m="826620">we</span> <span m="826740">can</span> <span m="826960">transition</span> <span m="827570">this</span> <span m="827860">into,</span> <span m="828670">for</span> <span m="828910">example,</span> <span m="829460">emptying</span> <span m="830180">the</span> <span m="830560">a</span> <span m="830730">gallon</span> <span m="831040">jug.</span> <span m="831420">So</span> <span m="831850">be y of</span> <span m="832290">0.</span> <span m="833540">Or</span> <span m="835750">we</span> <span m="835920">can</span> <span m="836100">empty the</span> <span m="838240">b jug.</span> </p>
<p><span m="840420">Well, filling</span> <span m="840910">is</span> <span m="841000">something</span> <span m="841300">similar.</span> </p>
<p></p>
<p><span m="845710">But</span> <span m="845900">now</span> <span m="846110">we</span> <span m="846270">are</span> <span m="846460">actually</span> <span m="848090">pouring</span> <span m="848760">more</span> <span m="849730">water</span> <span m="850120">from</span> <span m="850310">the</span> <span m="850400">fountain,</span> <span m="850860">essentially.</span> <span m="851430">Right?</span> <span m="851800">All</span> <span m="852030">those</span> <span m="852410">tennis</span> <span m="852730">balls</span> <span m="853050">here.</span> <span m="853930">And</span> <span m="855840">we</span> <span m="855990">can</span> <span m="856550">fill</span> <span m="856880">up</span> <span m="857200">say</span> <span m="857410">the</span> <span m="857750">a gallon</span> <span m="858100">up to</span> <span m="858500">a</span> <span m="859000">gallons,</span> <span m="860430">and</span> <span m="860590">leave the</span> <span m="860910">b</span> <span m="861230">jug</span> <span m="862110">as it</span> <span m="862550">is.</span> <span m="863410">Or</span> <span m="865325">w</span> <span m="865790">we</span> <span m="865900">can</span> <span m="866070">fill</span> <span m="866270">up</span> <span m="866390">the b</span> <span m="866640">gallon</span> <span m="866910">jug,</span> <span m="867960">and</span> <span m="868140">leave</span> <span m="869042">the</span> <span m="869410">a gallon</span> <span m="869720">jug</span> <span m="870410">as</span> <span m="870560">it</span> <span m="870630">is.</span> <span m="872520">So</span> <span m="872590">these</span> <span m="872830">are these two</span> <span m="873000">transitions.</span> <span m="874670">And</span> <span m="876990">the</span> <span m="877110">pouring</span> <span m="877560">of</span> <span m="877780">one--</span> <span m="879025">of one</span> <span m="879440">jug</span> <span m="879800">into</span> <span m="880030">the</span> <span m="880190">other</span> <span m="880570">is</span> <span m="880740">actually</span> <span m="881370">a</span> <span m="881400">little</span> <span m="881580">bit</span> <span m="881700">more</span> <span m="881890">complex.</span> <span m="882570">So let's</span> <span m="882996">have a</span> <span m="883422">look.</span> </p>
<p></p>
<p><span m="887370">So</span> <span m="887850">how does</span> <span m="888080">pouring</span> <span m="888350">work?</span> <span m="889770">Well,</span> <span m="891180">suppose</span> <span m="891650">we</span> <span m="891790">start</span> <span m="893106">with</span> <span m="894080">x</span> <span m="894520">and</span> <span m="894730">y.</span> <span m="895000">So</span> <span m="895460">let's</span> <span m="895690">have</span> <span m="895830">a</span> <span m="895900">look</span> <span m="896090">here.</span> <span m="897920">Um,</span> <span m="898240">I don't know.</span> <span m="898270">Suppose</span> <span m="898730">we</span> <span m="898840">have</span> <span m="899150">2</span> <span m="899260">balls</span> <span m="899370">in</span> <span m="899640">here,</span> <span m="899910">and</span> <span m="900160">2</span> <span m="900400">balls in</span> <span m="900800">here.</span> <span m="902450">Well,</span> <span m="902700">in</span> <span m="902820">that</span> <span m="903050">case,</span> <span m="903460">I</span> <span m="903560">can</span> <span m="903680">say</span> <span m="903950">pour</span> <span m="904370">all</span> <span m="904670">of</span> <span m="904790">these</span> <span m="905020">over in</span> <span m="905230">here.</span> <span m="906400">Right?</span> <span m="907670">So</span> <span m="907830">that's</span> <span m="908040">easy.</span> <span m="908930">But</span> <span m="909050">there's</span> <span m="909210">also</span> <span m="909540">another</span> <span m="909790">possibility,</span> <span m="910990">better</span> <span m="911920">when</span> <span m="912080">I</span> <span m="912160">pour</span> <span m="912570">all</span> <span m="912890">of these</span> <span m="913365">over in here.</span> <span m="913840">But hey,</span> <span m="914270">I</span> <span m="914340">can</span> <span m="914660">only</span> <span m="914990">put</span> <span m="915190">in</span> <span m="915320">1</span> <span m="915950">ball,</span> <span m="916340">because</span> <span m="916690">it's</span> <span m="916930">only</span> <span m="917240">a three</span> <span m="917470">gallon</span> <span m="917740">jug.</span> <span m="919000">So</span> <span m="919380">I'm</span> <span m="919770">left</span> <span m="920220">with</span> <span m="920390">only</span> <span m="920680">1.</span> <span m="922170">A</span> <span m="922570">gallon</span> <span m="924130">in</span> <span m="924250">this</span> <span m="924450">jug.</span> </p>
<p><span m="925410">So</span> <span m="925560">these</span> <span m="925780">are</span> <span m="925900">two--</span> <span m="927110">these</span> <span m="927260">are</span> <span m="927360">two</span> <span m="927530">situations</span> <span m="928390">that</span> <span m="928510">we</span> <span m="928600">need</span> <span m="928790">to</span> <span m="928900">explain.</span> <span m="930080">So</span> <span m="930260">let's</span> <span m="930790">first</span> <span m="931250">do</span> <span m="931550">the</span> <span m="931660">first</span> <span m="932280">example</span> <span m="932600">that</span> <span m="932920">I just</span> <span m="933060">did.</span> <span m="934400">I</span> <span m="934530">pour</span> <span m="934840">everything</span> <span m="935360">over into</span> <span m="935810">the</span> <span m="936040">other jug.</span> <span m="937210">So</span> <span m="938990">we</span> <span m="939180">have</span> <span m="939290">0</span> <span m="939630">gallons</span> <span m="940030">left</span> <span m="940280">in here,</span> <span m="941440">and</span> <span m="941670">x</span> <span m="941960">plus</span> <span m="942210">y</span> <span m="942440">gallons</span> <span m="942910">left</span> <span m="943480">in</span> <span m="943910">the other</span> <span m="944220">jug.</span> <span m="945800">And</span> <span m="945980">this</span> <span m="946140">can</span> <span m="946570">happen</span> <span m="947840">if</span> <span m="948070">there's</span> <span m="948270">sufficient</span> <span m="948760">space,</span> <span m="949210">right?</span> <span m="950160">So</span> <span m="950720">this</span> <span m="950930">can</span> <span m="951090">only</span> <span m="951360">happen</span> <span m="951890">if</span> <span m="952160">x</span> <span m="952450">plus</span> <span m="952700">y</span> <span m="953110">is</span> <span m="953300">at</span> <span m="953450">most</span> <span m="954050">b.</span> <span m="955320">Which</span> <span m="955590">is</span> <span m="955730">the</span> <span m="955820">capacity</span> <span m="956510">of</span> <span m="956640">this</span> <span m="957185">b</span> <span m="957450">gallon</span> <span m="957760">jug.</span> <span m="959530">Now</span> <span m="959720">if</span> <span m="959840">that's</span> <span m="960060">not</span> <span m="960230">the</span> <span m="960350">case,</span> <span m="960710">then</span> <span m="961070">I</span> <span m="961170">can</span> <span m="961270">pour in</span> <span m="961710">just</span> <span m="962400">a</span> <span m="962440">little</span> <span m="962680">bit,</span> <span m="962880">like</span> <span m="963130">just</span> <span m="963530">say</span> <span m="963710">1</span> <span m="963930">ball.</span> <span m="964680">Like</span> <span m="965960">just</span> <span m="966100">one</span> <span m="966370">of</span> <span m="966550">these</span> <span m="967010">can</span> <span m="967170">go</span> <span m="967370">in</span> <span m="967470">here.</span> <span m="968480">So</span> <span m="968610">that's</span> <span m="968800">the</span> <span m="968920">other</span> <span m="969110">case.</span> </p>
<p><span m="970090">So</span> <span m="972900">x, y</span> <span m="974100">we'll</span> <span m="974290">actually</span> <span m="974710">go</span> <span m="974970">to--</span> <span m="976450">well,</span> <span m="976620">let's</span> <span m="976930">just</span> <span m="977110">see</span> <span m="977330">how</span> <span m="977510">this</span> <span m="977720">works.</span> <span m="979580">How</span> <span m="979760">many</span> <span m="980030">gallons</span> <span m="980730">are</span> <span m="980750">left</span> <span m="981440">in this</span> <span m="981650">b</span> <span m="981740">gallon</span> <span m="982210">jug</span> <span m="983730">to</span> <span m="983850">fill</span> <span m="984090">up?</span> <span m="985260">Well,</span> <span m="986160">we</span> <span m="986330">have</span> <span m="986680">b</span> <span m="986930">minus</span> <span m="987330">y</span> <span m="987550">gallons</span> <span m="988010">left, right?</span> <span m="988600">Space</span> <span m="989200">left.</span> <span m="990080">So</span> <span m="990240">we</span> <span m="990370">can</span> <span m="990560">take</span> <span m="990890">b</span> <span m="991050">minus</span> <span m="991440">y</span> <span m="992200">gallons</span> <span m="993010">out of this</span> <span m="993220">one</span> <span m="993790">to</span> <span m="993950">fill</span> <span m="994200">up</span> <span m="994360">this</span> <span m="994590">one.</span> <span m="995410">So</span> <span m="995610">let's</span> <span m="995840">do</span> <span m="996000">it.</span> </p>
<p><span m="997170">We</span> <span m="997370">take</span> <span m="998590">b</span> <span m="998780">minus</span> <span m="999220">y</span> <span m="999490">gets</span> <span m="999920">out</span> <span m="1000170">of</span> <span m="1001200">the a jug,</span> <span m="1002580">and</span> <span m="1002790">put</span> <span m="1003010">it</span> <span m="1003200">all</span> <span m="1003480">in</span> <span m="1003570">here,</span> <span m="1004360">and</span> <span m="1004520">it</span> <span m="1004630">makes</span> <span m="1004890">it</span> <span m="1004980">completely</span> <span m="1005390">filled</span> <span m="1005690">up.</span> <span m="1006300">So</span> <span m="1006490">we</span> <span m="1006760">have</span> <span m="1006900">b gallons</span> <span m="1007150">over</span> <span m="1007490">here.</span> <span m="1008800">So</span> <span m="1008940">this</span> <span m="1009160">is</span> <span m="1009300">really</span> <span m="1009570">equal</span> <span m="1010010">to</span> <span m="1010400">x</span> <span m="1011720">plus</span> <span m="1012030">y</span> <span m="1012280">minus</span> <span m="1012740">b,</span> <span m="1014730">comma</span> <span m="1015030">b.</span> <span m="1016350">And</span> <span m="1016560">this</span> <span m="1016750">only</span> <span m="1018780">is</span> <span m="1018970">possible</span> <span m="1019850">if--</span> <span m="1021200">if</span> <span m="1021400">you</span> <span m="1021540">are</span> <span m="1021840">essentially</span> <span m="1023010">in the</span> <span m="1023170">complimentary</span> <span m="1023850">case.</span> <span m="1025119">So</span> <span m="1026400">we</span> <span m="1026569">have</span> <span m="1027160">that</span> <span m="1028810">x</span> <span m="1029210">plus</span> <span m="1029560">y</span> <span m="1030640">is</span> <span m="1030880">at</span> <span m="1031000">least</span> <span m="1031380">b,</span> <span m="1032980">such</span> <span m="1033290">that</span> <span m="1033430">there is</span> <span m="1033829">enough</span> <span m="1035140">gallons</span> <span m="1036319">in</span> <span m="1037319">the</span> <span m="1037660">a jug</span> <span m="1039720">to</span> <span m="1039869">be</span> <span m="1040010">poured</span> <span m="1040240">over</span> <span m="1040660">to</span> <span m="1040800">fill</span> <span m="1041020">up</span> <span m="1041630">the</span> <span m="1041710">b jug.</span> </p>
<p><span m="1042460">So</span> <span m="1042609">these</span> <span m="1042839">are</span> <span m="1042890">the</span> <span m="1043020">two</span> <span m="1043250">kinds</span> <span m="1043530">of</span> <span m="1043660">cases.</span> <span m="1044430">And,</span> <span m="1044560">of</span> <span m="1044680">course,</span> <span m="1044900">by</span> <span m="1044990">symmetry</span> <span m="1045900">we</span> <span m="1046040">can</span> <span m="1046180">do</span> <span m="1046280">also</span> <span m="1046550">the</span> <span m="1046670">pouring</span> <span m="1047410">from</span> <span m="1047609">the other</span> <span m="1047760">jug</span> <span m="1048810">into</span> <span m="1049400">the</span> <span m="1049480">first.</span> <span m="1049830">So</span> <span m="1050220">let's</span> <span m="1050420">write</span> <span m="1050630">all</span> <span m="1050840">those</span> <span m="1051150">out,</span> <span m="1051430">as</span> <span m="1051580">well.</span> <span m="1052650">So</span> <span m="1053450">x, y</span> <span m="1054870">can</span> <span m="1055040">actually</span> <span m="1055360">go</span> <span m="1055590">to</span> <span m="1056430">x</span> <span m="1056800">plus</span> <span m="1057260">y,</span> <span m="1057580">comma</span> <span m="1057890">0.</span> <span m="1058530">I</span> <span m="1058650">pour</span> <span m="1058910">everything</span> <span m="1059870">from</span> <span m="1060030">here</span> <span m="1060260">to</span> <span m="1060420">there.</span> <span m="1061750">And</span> <span m="1063020">this</span> <span m="1063200">only</span> <span m="1063480">holds</span> <span m="1064040">if</span> <span m="1064290">x</span> <span m="1064610">plus</span> <span m="1064910">y</span> <span m="1065750">is</span> <span m="1066670">at</span> <span m="1066860">most</span> <span m="1067170">a.</span> </p>
<p></p>
<p><span m="1074970">The</span> <span m="1075100">other</span> <span m="1075270">possibility</span> <span m="1076010">is</span> <span m="1076910">where,</span> <span m="1078260">exactly</span> <span m="1078655">as</span> <span m="1079050">in</span> <span m="1079130">this</span> <span m="1079360">case,</span> <span m="1079720">we</span> <span m="1079810">can</span> <span m="1079960">only</span> <span m="1080210">pour</span> <span m="1083440">a</span> <span m="1083570">minus</span> <span m="1084000">x</span> <span m="1084250">gallons</span> <span m="1084570">over</span> <span m="1084920">from</span> <span m="1085190">y</span> <span m="1086170">into</span> <span m="1086700">this</span> <span m="1087140">particular</span> <span m="1087570">jug.</span> <span m="1088220">And</span> <span m="1088280">then</span> <span m="1088430">this</span> <span m="1088740">one is</span> <span m="1088860">completely</span> <span m="1089270">filled</span> <span m="1089540">up.</span> <span m="1090300">And</span> <span m="1091090">then I have</span> <span m="1091320">a</span> <span m="1091370">few</span> <span m="1091580">gallons</span> <span m="1091940">left</span> <span m="1092200">over</span> <span m="1092450">here.</span> <span m="1092740">So</span> <span m="1092950">how</span> <span m="1093110">does</span> <span m="1093290">that</span> <span m="1093470">look?</span> <span m="1094910">Well,</span> <span m="1096880">we</span> <span m="1096990">completely</span> <span m="1097500">fill</span> <span m="1097770">this</span> <span m="1098000">up</span> <span m="1099740">to</span> <span m="1099830">its</span> <span m="1100010">capacity.</span> <span m="1101460">And</span> <span m="1102030">what is</span> <span m="1102380">left</span> <span m="1102680">this</span> <span m="1102910">is</span> <span m="1103140">y</span> <span m="1103630">minus--</span> <span m="1104210">how</span> <span m="1104360">much</span> <span m="1104520">did we</span> <span m="1105230">have</span> <span m="1105450">to</span> <span m="1105920">pour in</span> <span m="1105960">here?</span> <span m="1106990">Well,</span> <span m="1107780">that's</span> <span m="1108110">a</span> <span m="1108540">minus</span> <span m="1109010">x.</span> </p>
<p><span m="1111180">And we</span> <span m="1111400">again</span> <span m="1111760">have</span> <span m="1111870">a</span> <span m="1111950">similar</span> <span m="1112300">formula.</span> <span m="1114920">But it now</span> <span m="1115100">looks</span> <span m="1115340">a</span> <span m="1115380">little</span> <span m="1115590">bit</span> <span m="1115740">different.</span> <span m="1116870">X</span> <span m="1117150">plus</span> <span m="1117350">y</span> <span m="1117560">minus</span> <span m="1118050">a.</span> <span m="1118720">And</span> <span m="1118940">this</span> <span m="1119200">is</span> <span m="1119430">only</span> <span m="1119680">for the case</span> <span m="1120200">where</span> <span m="1120510">x</span> <span m="1120810">plus</span> <span m="1121090">y</span> <span m="1121880">is</span> <span m="1124370">at</span> <span m="1124490">least</span> <span m="1124800">a.</span> </p>
<p><span m="1128120">OK.</span> <span m="1128390">So</span> <span m="1128540">these</span> <span m="1128820">are</span> <span m="1128930">all</span> <span m="1129180">the</span> <span m="1129290">cases.</span> <span m="1130050">So</span> <span m="1130860">maybe</span> <span m="1131310">there</span> <span m="1131490">are</span> <span m="1131560">some</span> <span m="1131740">questions</span> <span m="1132200">about</span> <span m="1132550">this.</span> <span m="1132990">Is</span> <span m="1133150">this</span> <span m="1133330">clear,</span> <span m="1134670">that</span> <span m="1134810">we</span> <span m="1134910">have</span> <span m="1135230">these</span> <span m="1135470">different</span> <span m="1136030">possibilities?</span> <span m="1136940">Like</span> <span m="1137160">when</span> <span m="1137300">we</span> <span m="1137440">look</span> <span m="1137650">at</span> <span m="1137990">these</span> <span m="1138300">jugs</span> <span m="1138590">we</span> <span m="1138670">can</span> <span m="1138780">either</span> <span m="1139090">empty</span> <span m="1139430">them,</span> <span m="1139640">filling</span> <span m="1139950">them</span> <span m="1140120">up.</span> <span m="1140840">Or</span> <span m="1141010">we</span> <span m="1141170">can</span> <span m="1141880">pour</span> <span m="1142410">say</span> <span m="1142630">only</span> <span m="1142920">1</span> <span m="1143200">ball</span> <span m="1143480">over</span> <span m="1143810">up</span> <span m="1144260">to</span> <span m="1144460">the</span> <span m="1144580">full</span> <span m="1144790">capacity</span> <span m="1145300">of</span> <span m="1145400">this</span> <span m="1145600">jug.</span> <span m="1145940">Or</span> <span m="1146250">we</span> <span m="1146370">can</span> <span m="1146530">just</span> <span m="1146810">pour everything</span> <span m="1147370">over</span> <span m="1148000">into,</span> <span m="1148280">say,</span> <span m="1148520">this</span> <span m="1148740">jug.</span> </p>
<p><span m="1149660">So</span> <span m="1149750">those</span> <span m="1150120">are the</span> <span m="1150210">different</span> <span m="1150580">cases</span> <span m="1151470">that</span> <span m="1151620">are</span> <span m="1151680">now</span> <span m="1151880">fully</span> <span m="1152190">described</span> <span m="1152660">by</span> <span m="1152780">this</span> <span m="1153010">state</span> <span m="1153260">machine.</span> <span m="1154380">So</span> <span m="1154520">now</span> <span m="1154760">we</span> <span m="1154890">can</span> <span m="1155040">start</span> <span m="1155390">to</span> <span m="1155480">prove</span> <span m="1155770">this</span> <span m="1155990">theorem</span> <span m="1156380">over</span> <span m="1156640">here.</span> <span m="1158100">So</span> <span m="1158350">how</span> <span m="1158510">do</span> <span m="1158610">we</span> <span m="1158750">go</span> <span m="1158980">ahead?</span> <span m="1160410">How are we going</span> <span m="1160850">to</span> <span m="1160970">use</span> <span m="1161430">what</span> <span m="1161640">you've</span> <span m="1161870">learned</span> <span m="1162210">like</span> <span m="1163260">induction,</span> <span m="1164100">and</span> <span m="1164380">invariance?</span> <span m="1165660">So</span> <span m="1165750">let's</span> <span m="1165940">do</span> <span m="1166100">it.</span> </p>
<p><span m="1167880">But</span> <span m="1168050">before,</span> <span m="1168840">actually,</span> <span m="1169720">we</span> <span m="1169830">do</span> <span m="1170040">this,</span> <span m="1170470">let's</span> <span m="1171730">take</span> <span m="1172090">this</span> <span m="1172280">example</span> <span m="1172565">that</span> <span m="1172850">we</span> <span m="1172940">had</span> <span m="1174940">and</span> <span m="1175130">see</span> <span m="1175310">how</span> <span m="1175530">we</span> <span m="1175690">can</span> <span m="1177420">describe</span> <span m="1177770">all</span> <span m="1178120">the</span> <span m="1178180">transitions</span> <span m="1178740">that we just did,</span> <span m="1180030">as</span> <span m="1180140">far</span> <span m="1180300">as</span> <span m="1180450">I</span> <span m="1180560">remember</span> <span m="1180950">them.</span> <span m="1181920">So</span> <span m="1182140">we</span> <span m="1182260">have that</span> <span m="1182460">a</span> <span m="1182890">equals</span> <span m="1183350">3,</span> <span m="1184055">b</span> <span m="1184310">equals</span> <span m="1185000">5.</span> <span m="1185850">Right?</span> <span m="1187320">We</span> <span m="1187430">start</span> <span m="1188470">with</span> <span m="1188830">empty</span> <span m="1189050">jugs.</span> <span m="1191760">We</span> <span m="1191970">need</span> <span m="1192330">to</span> <span m="1192600">filled</span> <span m="1192950">up</span> <span m="1193400">the</span> <span m="1193500">five</span> <span m="1193830">gallon</span> <span m="1194010">jug,</span> <span m="1194480">right?</span> </p>
<p></p>
<p><span m="1199060">Then</span> <span m="1199250">we</span> <span m="1199350">started</span> <span m="1200750">pouring</span> <span m="1201670">the</span> <span m="1201780">five</span> <span m="1202180">gallon</span> <span m="1202480">jug</span> <span m="1202860">as</span> <span m="1203030">much</span> <span m="1203330">as</span> <span m="1203460">we</span> <span m="1203610">could</span> <span m="1203810">into</span> <span m="1203960">the</span> <span m="1204050">three</span> <span m="1204390">gallon</span> <span m="1204650">jug.</span> <span m="1205240">So</span> <span m="1205410">it's</span> <span m="1205540">one</span> <span m="1205700">of</span> <span m="1205770">those</span> <span m="1206000">rules.</span> <span m="1207100">We've</span> <span m="1207220">got</span> <span m="1207500">3</span> <span m="1207920">into</span> <span m="1208220">2.</span> <span m="1209860">Then</span> <span m="1210050">we</span> <span m="1210385">emptied</span> <span m="1210720">the</span> <span m="1211390">three</span> <span m="1211670">gallon jug.</span> <span m="1213080">We got</span> <span m="1213350">0</span> <span m="1213770">and</span> <span m="1214000">2.</span> <span m="1216940">Then</span> <span m="1217250">we</span> <span m="1217540">did--</span> <span m="1218730">What did we</span> <span m="1219110">did</span> <span m="1219310">next?</span> <span m="1220070">Oh yeah,</span> <span m="1220340">we</span> <span m="1221100">poured</span> <span m="1221410">everything</span> <span m="1222480">into</span> <span m="1222550">this</span> <span m="1222790">one.</span> <span m="1224750">So</span> <span m="1225010">we</span> <span m="1225120">have</span> <span m="1225300">2,</span> <span m="1225690">0</span> <span m="1226200">as</span> <span m="1226500">the</span> <span m="1226590">next</span> <span m="1226860">state.</span> <span m="1228890">We</span> <span m="1229090">filled</span> <span m="1229400">up--</span> <span m="1232630">actually</span> <span m="1233000">I</span> <span m="1233190">forgot</span> <span m="1234000">exactly</span> <span m="1234490">what</span> <span m="1234620">we</span> <span m="1234740">did</span> <span m="1234920">next.</span> <span m="1235550">But</span> <span m="1235870">I</span> <span m="1235980">think</span> <span m="1236250">we</span> <span m="1236580">filled</span> <span m="1237030">up</span> <span m="1237330">the</span> <span m="1237430">five</span> <span m="1237820">gallon</span> <span m="1238110">jug.</span> <span m="1240790">And then we</span> <span m="1240890">simply</span> <span m="1241320">poured</span> <span m="1241820">over</span> <span m="1242710">as</span> <span m="1242930">much</span> <span m="1243170">as</span> <span m="1243300">he</span> <span m="1243420">could</span> <span m="1243640">from</span> <span m="1243790">the</span> <span m="1243870">five</span> <span m="1244180">gallon</span> <span m="1244430">jug.</span> <span m="1245400">And</span> <span m="1245600">we</span> <span m="1245760">got</span> <span m="1246180">3</span> <span m="1246840">and</span> <span m="1247020">4,</span> <span m="1248090">and</span> <span m="1248645">here we are.</span> <span m="1249040">We got</span> <span m="1249400">4</span> <span m="1249630">gallons.</span> </p>
<p><span m="1251440">So</span> <span m="1252820">what</span> <span m="1253030">we</span> <span m="1253130">just</span> <span m="1253450">did</span> <span m="1253690">is</span> <span m="1253890">fully</span> <span m="1254120">describe</span> <span m="1254610">this</span> <span m="1254750">state</span> <span m="1255100">machine.</span> <span m="1255430">So</span> <span m="1255580">let's</span> <span m="1255760">not</span> <span m="1255950">try</span> <span m="1256130">to</span> <span m="1256260">prove this</span> <span m="1256620">theorem.</span> </p>
<p></p>
<p><span m="1262960">So</span> <span m="1263130">as</span> <span m="1263310">I</span> <span m="1263360">said,</span> <span m="1263640">we're</span> <span m="1263760">going</span> <span m="1263940">to</span> <span m="1264040">use</span> <span m="1264230">induction.</span> </p>
<p></p>
<p><span m="1269660">So</span> <span m="1270830">you</span> <span m="1270990">always</span> <span m="1271270">would</span> <span m="1271430">like</span> <span m="1271640">to</span> <span m="1271800">write</span> <span m="1272050">this</span> <span m="1272280">out</span> <span m="1273840">if</span> <span m="1274050">you</span> <span m="1274310">solve</span> <span m="1274630">your</span> <span m="1274700">problems.</span> <span m="1277880">What</span> <span m="1277920">are</span> <span m="1278020">we</span> <span m="1278120">going</span> <span m="1278410">to</span> <span m="1278590">assume?</span> <span m="1279810">Well,</span> <span m="1280510">we assume</span> <span m="1282720">actually</span> <span m="1283130">that</span> <span m="1283410">m</span> <span m="1283750">defines</span> <span m="1284240">a,</span> <span m="1285170">and</span> <span m="1285670">m defines</span> <span m="1286280">also</span> <span m="1286920">b.</span> <span m="1288110">That's the</span> <span m="1288290">assumption</span> <span m="1288750">of</span> <span m="1288860">the</span> <span m="1288940">theorem,</span> <span m="1289460">and</span> <span m="1289610">now</span> <span m="1289760">we</span> <span m="1289840">need</span> <span m="1289980">to</span> <span m="1290080">prove</span> <span m="1290630">that</span> <span m="1291350">defies</span> <span m="1291830">any</span> <span m="1292220">result</span> <span m="1292460">that</span> <span m="1292600">you</span> <span m="1292730">can</span> <span m="1292880">achieve</span> <span m="1293960">in</span> <span m="1294090">this</span> <span m="1294260">state</span> <span m="1294550">machine.</span> <span m="1296340">So</span> <span m="1296520">what's</span> <span m="1296740">the</span> <span m="1296890">invariance</span> <span m="1297760">that we</span> <span m="1297920">are</span> <span m="1298680">thinking</span> <span m="1299060">about?</span> </p>
<p></p>
<p><span m="1303090">Invariance</span> <span m="1303210">is</span> <span m="1303720">going</span> <span m="1304180">to</span> <span m="1304330">be--</span> </p>
<p></p>
<p><span m="1307570">Oops.</span> </p>
<p><span m="1310890">It's a</span> <span m="1311150">predicate.</span> <span m="1313530">And</span> <span m="1313710">it</span> <span m="1313810">says</span> <span m="1314090">something</span> <span m="1314470">like,</span> <span m="1316310">if</span> <span m="1316580">the</span> <span m="1316670">state</span> <span m="1318920">xy--</span> <span m="1320000">if</span> <span m="1320160">this</span> <span m="1320370">is</span> <span m="1320600">the</span> <span m="1320690">state</span> <span m="1322260">after</span> <span m="1322660">n</span> <span m="1323120">transitions--</span> </p>
<p></p>
<p><span m="1334300">Then</span> <span m="1334470">we</span> <span m="1334570">would</span> <span m="1334730">like</span> <span m="1335030">to</span> <span m="1335210">conclude</span> <span m="1335505">that</span> <span m="1338390">m</span> <span m="1338670">the</span> <span m="1338800">fights</span> <span m="1339230">both</span> <span m="1339620">x,</span> <span m="1340900">and</span> <span m="1341490">m</span> <span m="1341630">defines</span> <span m="1341980">y.</span> <span m="1343220">So</span> <span m="1343390">this</span> <span m="1343690">is</span> <span m="1344340">our--</span> <span m="1345910">our</span> <span m="1346330">invariance.</span> <span m="1347150">And</span> <span m="1347810">we</span> <span m="1347940">like</span> <span m="1348130">to</span> <span m="1348250">use</span> <span m="1348600">this</span> <span m="1348710">to</span> <span m="1348810">prove</span> <span m="1349210">our</span> <span m="1349270">theorem.</span> <span m="1349690">So</span> <span m="1349870">how</span> <span m="1350000">do</span> <span m="1350100">we</span> <span m="1350200">start</span> <span m="1350550">usually,</span> <span m="1351000">right?</span> <span m="1351280">So</span> <span m="1351750">we</span> <span m="1351880">always</span> <span m="1352110">start</span> <span m="1352450">with--</span> <span m="1353250">with</span> <span m="1353740">a</span> <span m="1353820">base</span> <span m="1354270">state.</span> <span m="1354500">Great.</span> <span m="1355690">So</span> <span m="1356030">let's</span> <span m="1356440">do</span> <span m="1356580">it.</span> </p>
<p></p>
<p><span m="1360690">The</span> <span m="1360770">base</span> <span m="1361100">case</span> <span m="1361510">is--</span> <span m="1363660">well,</span> <span m="1364020">we</span> <span m="1364150">start</span> <span m="1364830">with</span> <span m="1365120">the</span> <span m="1365250">all</span> <span m="1365440">0s,</span> <span m="1366880">like</span> <span m="1367110">the</span> <span m="1367210">empty jugs.</span> <span m="1369400">It's--</span> <span m="1370330">well,</span> <span m="1370490">and we</span> <span m="1370630">also--</span> <span m="1372390">have</span> <span m="1372790">paid</span> <span m="1372920">a little</span> <span m="1373330">bit</span> <span m="1373400">of extra</span> <span m="1373650">attention</span> <span m="1374160">to</span> <span m="1374290">what</span> <span m="1374490">we</span> <span m="1374590">mean</span> <span m="1374810">by</span> <span m="1374980">division</span> <span m="1375520">over</span> <span m="1375820">here.</span> <span m="1376120">We</span> <span m="1376230">said</span> <span m="1376570">that</span> <span m="1376720">all</span> <span m="1376970">integers</span> <span m="1378120">actually</span> <span m="1378540">divide</span> <span m="1379570">0.</span> <span m="1380400">So in</span> <span m="1380610">particular,</span> <span m="1381120">m.</span> <span m="1381610">m</span> <span m="1381830">divides</span> <span m="1382220">0.</span> <span m="1382790">m,</span> <span m="1382960">0.</span> <span m="1384450">So</span> <span m="1384740">the</span> <span m="1384860">very</span> <span m="1385420">initial</span> <span m="1385910">state,</span> <span m="1386560">0</span> <span m="1386880">comma</span> <span m="1387100">0,</span> <span m="1387790">is</span> <span m="1388050">indeed</span> <span m="1391500">complying</span> <span m="1392220">to</span> <span m="1392760">is</span> <span m="1392900">particular</span> <span m="1393340">invariant.</span> <span m="1393760">So</span> <span m="1394680">let's</span> <span m="1394880">write</span> <span m="1395080">it</span> <span m="1395210">out.</span> <span m="1396070">So</span> <span m="1396320">we</span> <span m="1396470">have the</span> <span m="1396870">initial</span> <span m="1397290">state</span> <span m="1397640">0,</span> <span m="1397980">0.</span> <span m="1399000">We</span> <span m="1399110">know that</span> <span m="1399530">m</span> <span m="1399690">divides</span> <span m="1400240">0.</span> <span m="1401360">And</span> <span m="1401530">therefore,</span> <span m="1401980">we</span> <span m="1402130">know</span> <span m="1403200">that</span> <span m="1403520">p</span> <span m="1403690">0</span> <span m="1404770">is</span> <span m="1405690">true.</span> <span m="1407060">So</span> <span m="1407100">that's</span> <span m="1407310">great.</span> </p>
<p><span m="1408920">So</span> <span m="1409080">the</span> <span m="1409200">inductive</span> <span m="1409600">step.</span> <span m="1411380">How</span> <span m="1411470">do we</span> <span m="1411570">start the</span> <span m="1411930">inductive</span> <span m="1412390">step--</span> <span m="1413380">step</span> <span m="1413700">all</span> <span m="1413860">the</span> <span m="1414270">time?</span> </p>
<p></p>
<p><span m="1418720">And</span> <span m="1418860">we</span> <span m="1419030">will</span> <span m="1419390">assume,</span> <span m="1419930">actually,</span> <span m="1421000">p of n,</span> <span m="1421100">right?</span> <span m="1422420">So</span> <span m="1422620">lets</span> <span m="1422980">assume</span> <span m="1423550">that.</span> <span m="1425230">And</span> <span m="1425400">now</span> <span m="1425540">we</span> <span m="1425640">would</span> <span m="1425810">like</span> <span m="1426050">to</span> <span m="1426180">prove</span> <span m="1429682">p,</span> <span m="1430088">and then</span> <span m="1430494">n</span> <span m="1430900">plus</span> <span m="1431120">1.</span> <span m="1431310">So</span> <span m="1431920">what</span> <span m="1432070">do</span> <span m="1432160">we</span> <span m="1432290">really</span> <span m="1432510">want</span> <span m="1432690">to</span> <span m="1432810">do?</span> <span m="1433620">We</span> <span m="1433750">want</span> <span m="1433900">to</span> <span m="1434010">say,</span> <span m="1434300">well,</span> <span m="1435770">we</span> <span m="1435900">know</span> <span m="1436130">that</span> <span m="1436280">we</span> <span m="1436510">reached</span> <span m="1436990">a</span> <span m="1437070">certain</span> <span m="1437460">state</span> <span m="1437910">x</span> <span m="1438170">comma</span> <span m="1438470">y,</span> <span m="1439430">for</span> <span m="1439710">which</span> <span m="1440490">m</span> <span m="1441250">divides</span> <span m="1441370">x,</span> <span m="1442400">and</span> <span m="1442610">m divides</span> <span m="1443200">y.</span> <span m="1443810">Now we</span> <span m="1443980">would</span> <span m="1444160">like</span> <span m="1444370">to</span> <span m="1444480">show</span> <span m="1444800">that</span> <span m="1445330">if</span> <span m="1445530">we</span> <span m="1445840">transition</span> <span m="1446370">to</span> <span m="1446510">a</span> <span m="1446560">next</span> <span m="1446920">state,</span> <span m="1448190">we</span> <span m="1448360">again</span> <span m="1448690">have</span> <span m="1448840">that</span> <span m="1448960">same</span> <span m="1449230">property,</span> <span m="1449840">that m</span> <span m="1450050">divides</span> <span m="1451960">the</span> <span m="1452050">number</span> <span m="1452280">of</span> <span m="1452380">gallons</span> <span m="1452740">in both</span> <span m="1453100">jugs</span> <span m="1453510">once</span> <span m="1453840">more.</span> <span m="1454820">And</span> <span m="1454980">then</span> <span m="1455100">we</span> <span m="1455180">can</span> <span m="1455350">con--</span> <span m="1456200">can</span> <span m="1456350">conclude</span> <span m="1456760">p, n</span> <span m="1457090">plus</span> <span m="1457300">1.</span> <span m="1457700">So</span> <span m="1457870">that's</span> <span m="1459660">how</span> <span m="1459830">we</span> <span m="1459930">always</span> <span m="1460270">proceed.</span> <span m="1461020">So</span> <span m="1461110">let's</span> <span m="1461350">see</span> <span m="1461490">where we</span> <span m="1461780">can</span> <span m="1462280">write</span> <span m="1462500">it</span> <span m="1462610">out</span> <span m="1462900">in</span> <span m="1463020">a</span> <span m="1463260">bit</span> <span m="1463430">more</span> <span m="1463570">formal</span> <span m="1463980">way.</span> </p>
<p></p>
<p><span m="1469290">OK.</span> <span m="1469620">So</span> <span m="1470630">how</span> <span m="1470720">do</span> <span m="1470810">we</span> <span m="1470920">go</span> <span m="1471160">ahead?</span> <span m="1473270">Suppose</span> <span m="1473910">that</span> <span m="1475870">x, y</span> <span m="1478010">is</span> <span m="1478240">the</span> <span m="1478360">state</span> <span m="1481780">after</span> <span m="1484560">n</span> <span m="1484790">transitions.</span> </p>
<p></p>
<p><span m="1490350">Well,</span> <span m="1492160">what</span> <span m="1492360">can</span> <span m="1492490">we</span> <span m="1492590">conclude?</span> <span m="1493150">Well,</span> <span m="1493600">we</span> <span m="1493730">have</span> <span m="1495100">the</span> <span m="1495200">predicate</span> <span m="1495650">pn,</span> <span m="1495970">the</span> <span m="1496180">invariant.</span> <span m="1497160">So</span> <span m="1497450">we</span> <span m="1497580">know</span> <span m="1498630">that</span> <span m="1499090">n</span> <span m="1499810">divides</span> <span m="1500490">x,</span> <span m="1501220">and</span> <span m="1502810">n</span> <span m="1503110">divides</span> <span m="1503470">y.</span> <span m="1506390">And</span> <span m="1506550">we</span> <span m="1506680">concluded</span> <span m="1507180">that</span> <span m="1507420">because</span> <span m="1507840">pn</span> <span m="1508210">is</span> <span m="1508400">true.</span> </p>
<p></p>
<p><span m="1513320">So</span> <span m="1513630">after</span> <span m="1514000">another</span> <span m="1514260">transition--</span> <span m="1514900">what</span> <span m="1515030">happens</span> <span m="1515590">after</span> <span m="1515830">another</span> <span m="1516130">transition?</span> <span m="1517580">So</span> <span m="1519190">we</span> <span m="1519330">can</span> <span m="1519480">conclude</span> <span m="1520540">that</span> <span m="1521770">the</span> <span m="1521880">jugs</span> <span m="1525080">are</span> <span m="1525280">filled</span> <span m="1528240">by the</span> <span m="1528380">different</span> <span m="1529140">types</span> <span m="1530010">of</span> <span m="1530320">numbers</span> <span m="1530625">that</span> <span m="1530930">we</span> <span m="1531050">see</span> <span m="1531310">here</span> <span m="1531610">this</span> <span m="1531920">is</span> <span m="1532090">state</span> <span m="1532440">machine.</span> <span m="1532840">So</span> <span m="1533030">let's</span> <span m="1533250">write</span> <span m="1533460">them out.</span> <span m="1534660">So</span> <span m="1534810">after</span> <span m="1535060">another</span> <span m="1535340">transition,</span> <span m="1537130">um,</span> <span m="1540870">each</span> <span m="1541170">of</span> <span m="1541330">the</span> <span m="1541420">jugs</span> <span m="1544060">is</span> <span m="1544300">actually</span> <span m="1544670">filled--</span> <span m="1545890">Um,</span> <span m="1547440">are</span> <span m="1547660">filled</span> <span m="1551480">with--</span> <span m="1552840">well,</span> <span m="1553150">either</span> <span m="1553770">if</span> <span m="1554420">I've</span> <span m="1554760">emptied</span> <span m="1555150">it,</span> <span m="1555680">say</span> <span m="1555750">a</span> <span m="1556230">0,</span> <span m="1558250">0</span> <span m="1558610">gallons,</span> <span m="1560190">a, b,</span> <span m="1561060">x</span> <span m="1561360">and</span> <span m="1561520">y.</span> <span m="1561990">I</span> <span m="1562120">see</span> <span m="1562340">appearing</span> <span m="1562760">over</span> <span m="1563090">here.</span> <span m="1564060">And</span> <span m="1564250">I</span> <span m="1564350">also</span> <span m="1564620">notice</span> <span m="1565120">that</span> <span m="1565270">I see</span> <span m="1565580">x</span> <span m="1565840">plus</span> <span m="1566120">y.</span> <span m="1566810">And</span> <span m="1567000">x</span> <span m="1567190">plus</span> <span m="1567430">y,</span> <span m="1567620">minus</span> <span m="1568060">b.</span> <span m="1568330">And</span> <span m="1568500">x</span> <span m="1568710">plus</span> <span m="1568890">y,</span> <span m="1569040">minus</span> <span m="1569520">a.</span> <span m="1569980">Those</span> <span m="1570200">are</span> <span m="1570370">all</span> <span m="1570600">the</span> <span m="1570670">different</span> <span m="1571420">number</span> <span m="1571740">of</span> <span m="1572090">gallons</span> <span m="1572410">that can</span> <span m="1572520">be in</span> <span m="1572590">jug.</span> <span m="1573040">Yes,</span> <span m="1573360">please?</span> </p>
<p><span m="1574161">AUDIENCE: [INAUDIBLE]</span> </p>
<p></p>
<p><span m="1578490">PROFESSOR: In</span> <span m="1578710">our</span> <span m="1578860">example--</span> <span m="1579680">Yeah,</span> <span m="1579820">that's a good</span> <span m="1580250">question.</span> <span m="1580590">So</span> <span m="1580780">in</span> <span m="1580890">our</span> <span m="1581080">example</span> <span m="1581350">problems</span> <span m="1581620">of</span> <span m="1582000">3 and 5,</span> <span m="1583450">it</span> <span m="1583620">turns</span> <span m="1583970">out</span> <span m="1584580">that</span> <span m="1585490">the</span> <span m="1585650">only</span> <span m="1585950">number</span> <span m="1586260">that</span> <span m="1586480">divides</span> <span m="1586580">5</span> <span m="1586990">both</span> <span m="1587460">the</span> <span m="1587570">three</span> <span m="1587850">gallon</span> <span m="1588170">jug,</span> <span m="1588660">and</span> <span m="1588960">the</span> <span m="1589050">five</span> <span m="1589360">gallon</span> <span m="1589610">jugs is</span> <span m="1589920">actually</span> <span m="1590320">one.</span> <span m="1591390">So</span> <span m="1591850">in</span> <span m="1591980">our</span> <span m="1592140">example,</span> <span m="1593130">we</span> <span m="1593140">would</span> <span m="1593340">have</span> <span m="1593630">that</span> <span m="1593820">m</span> <span m="1594110">equals</span> <span m="1594480">1.</span> <span m="1595790">So</span> <span m="1597760">over</span> <span m="1598070">here</span> <span m="1600240">we</span> <span m="1600420">have</span> <span m="1600880">that</span> <span m="1601430">only</span> <span m="1602720">1</span> <span m="1603120">divides</span> <span m="1603160">a,</span> <span m="1604330">as</span> <span m="1604520">well</span> <span m="1604750">as</span> <span m="1604880">1</span> <span m="1605110">divides</span> <span m="1606080">b.</span> <span m="1607030">So</span> <span m="1607450">m</span> <span m="1607550">equals</span> <span m="1607870">1</span> <span m="1608720">in</span> <span m="1608890">our</span> <span m="1609110">case.</span> <span m="1609800">But</span> <span m="1610080">for</span> <span m="1610220">example,</span> <span m="1611120">in</span> <span m="1611320">the</span> <span m="1611710">three</span> <span m="1611950">gallon</span> <span m="1612240">jug,</span> <span m="1612600">and the six</span> <span m="1612990">gallon</span> <span m="1613240">jug--</span> <span m="1613770">Right?</span> <span m="1614650">We have</span> <span m="1615280">that</span> <span m="1615910">m</span> <span m="1616080">equals</span> <span m="1616430">3,</span> <span m="1617130">like</span> <span m="1617450">3</span> <span m="1617660">divides</span> <span m="1618550">3,</span> <span m="1619380">And</span> <span m="1619530">3</span> <span m="1619710">divides</span> <span m="1619810">6.</span> <span m="1621320">So</span> <span m="1621450">those</span> <span m="1621630">are</span> <span m="1621790">the</span> <span m="1621870">two</span> <span m="1622080">cases</span> <span m="1622450">that</span> <span m="1622590">you</span> <span m="1622660">sort</span> <span m="1622880">of</span> <span m="1622970">look</span> <span m="1623200">at</span> <span m="1623300">right</span> <span m="1623530">now.</span> <span m="1624630">But</span> <span m="1624810">you</span> <span m="1624890">put</span> <span m="1625060">into</span> <span m="1625480">a</span> <span m="1625540">much</span> <span m="1625760">more</span> <span m="1625910">general</span> <span m="1626200">setting,</span> <span m="1626620">right,</span> <span m="1626870">we</span> <span m="1626990">are</span> <span m="1627090">distracted</span> <span m="1627470">away</span> <span m="1627700">from</span> <span m="1627860">the</span> <span m="1627950">actual</span> <span m="1628330">numbers.</span> <span m="1629270">And</span> <span m="1629450">use</span> <span m="1630850">a</span> <span m="1631120">and</span> <span m="1631530">b</span> <span m="1631920">as</span> <span m="1632900">representations.</span> </p>
<p><span m="1635950">Are</span> <span m="1636170">any</span> <span m="1636370">other</span> <span m="1636530">questions?</span> </p>
<p><span m="1639130">So</span> <span m="1640330">after</span> <span m="1640470">another</span> <span m="1640740">transition,</span> <span m="1641730">each</span> <span m="1641960">of</span> <span m="1642070">the</span> <span m="1642160">jugs</span> <span m="1642790">are</span> <span m="1642960">filled</span> <span m="1643370">with,</span> <span m="1644090">well,</span> <span m="1644330">either</span> <span m="1644590">0</span> <span m="1644980">gallons,</span> <span m="1645590">if</span> <span m="1645770">we</span> <span m="1645890">have</span> <span m="1646280">a</span> <span m="1646430">completely</span> <span m="1647160">emptied</span> <span m="1647530">them.</span> <span m="1648120">Or</span> <span m="1648250">we</span> <span m="1648340">have</span> <span m="1648560">filled</span> <span m="1649310">the</span> <span m="1649420">first</span> <span m="1649740">a</span> <span m="1650060">gallon</span> <span m="1650510">jug,</span> <span m="1651300">or</span> <span m="1651750">it</span> <span m="1651880">can</span> <span m="1652040">be</span> <span m="1652200">b.</span> <span m="1653170">We</span> <span m="1653310">also</span> <span m="1653560">noticed</span> <span m="1654060">that</span> <span m="1654180">it</span> <span m="1654300">can</span> <span m="1654500">be--</span> <span m="1656040">it</span> <span m="1656200">can</span> <span m="1656390">be</span> <span m="1656730">of</span> <span m="1656995">x, of</span> <span m="1657260">course.</span> <span m="1657650">It</span> <span m="1657760">can</span> <span m="1657920">be</span> <span m="1658080">y,</span> <span m="1658590">because</span> <span m="1659370">that's</span> <span m="1659750">the state that</span> <span m="1660100">we are</span> <span m="1660530">in.</span> <span m="1661610">And</span> <span m="1662220">we</span> <span m="1662380">can</span> <span m="1664500">have</span> <span m="1664820">x</span> <span m="1665080">plus</span> <span m="1665690">y,</span> <span m="1666040">minus</span> <span m="1666540">a,</span> <span m="1666850">which</span> <span m="1667050">appears</span> <span m="1667410">over here.</span> <span m="1667950">And</span> <span m="1668240">x</span> <span m="1668490">plus</span> <span m="1668690">y,</span> <span m="1668890">minus</span> <span m="1669300">b.</span> </p>
<p></p>
<p><span m="1673770">So</span> <span m="1673960">these</span> <span m="1674260">are</span> <span m="1674520">all</span> <span m="1674780">the</span> <span m="1674890">different</span> <span m="1675290">number--</span> <span m="1678340">possible</span> <span m="1678670">number</span> <span m="1678910">of</span> <span m="1679020">gallons.</span> </p>
<p></p>
<p><span m="1682262">The</span> <span m="1682680">x</span> <span m="1682910">plus</span> <span m="1683160">y.</span> <span m="1684280">That's</span> <span m="1684510">also</span> <span m="1685160">present.</span> <span m="1686520">Is that</span> <span m="1686880">true?</span> <span m="1688754">Yeah. That's</span> <span m="1689192">right.</span> <span m="1689630">x</span> <span m="1689920">plus</span> <span m="1690150">y.</span> <span m="1690370">So</span> <span m="1690510">we</span> <span m="1690620">also</span> <span m="1690930">have</span> <span m="1691200">x</span> <span m="1691450">plus</span> <span m="1691640">y.</span> <span m="1693280">Actually,</span> <span m="1693630">it's</span> <span m="1693800">good</span> <span m="1693950">to</span> <span m="1694050">check</span> <span m="1694340">that</span> <span m="1694490">again.</span> <span m="1694980">So</span> <span m="1695120">we</span> <span m="1695230">have</span> <span m="1695400">0,</span> <span m="1696525">x,</span> <span m="1696960">y,</span> <span m="1697680">a, b.</span> <span m="1698340">Got those.</span> <span m="1699280">X</span> <span m="1699490">plus</span> <span m="1699710">y,</span> <span m="1700380">and</span> <span m="1700930">x plus</span> <span m="1701130">y,</span> <span m="1701230">minus</span> <span m="1701580">p, and</span> <span m="1701890">x plus</span> <span m="1702210">y</span> <span m="1702350">minus</span> <span m="1702750">b.</span> <span m="1704090">Yeah.</span> </p>
<p><span m="1706090">So</span> <span m="1706290">now</span> <span m="1706520">we</span> <span m="1706650">can</span> <span m="1707000">start</span> <span m="1707400">using</span> <span m="1708280">our--</span> <span m="1709860">our</span> <span m="1711210">assumptions.</span> <span m="1712120">So</span> <span m="1712450">what</span> <span m="1712610">our</span> <span m="1712760">they?</span> <span m="1713600">We</span> <span m="1713740">have</span> <span m="1715250">that</span> <span m="1715560">in</span> <span m="1715740">order</span> <span m="1715880">to</span> <span m="1716000">prove</span> <span m="1716420">this--</span> <span m="1716740">right?</span> <span m="1716980">At</span> <span m="1717260">the top</span> <span m="1717705">over</span> <span m="1718150">here,</span> <span m="1718730">we assume that m</span> <span m="1718980">divides,</span> <span m="1719560">and</span> <span m="1719940">m</span> <span m="1720320">divides</span> <span m="1720980">b.</span> <span m="1722420">So</span> <span m="1722850">we</span> <span m="1723030">know</span> <span m="1723950">that</span> <span m="1724830">first</span> <span m="1725140">of</span> <span m="1725190">all,</span> <span m="1725490">m</span> <span m="1725750">divides</span> <span m="1725970">0,</span> <span m="1726320">of</span> <span m="1726470">course.</span> <span m="1726900">But</span> <span m="1727020">we</span> <span m="1727410">know that</span> <span m="1727810">m</span> <span m="1728110">divides</span> <span m="1728590">a.</span> <span m="1729460">We know that</span> <span m="1729810">m</span> <span m="1730150">divides</span> <span m="1730610">b.</span> <span m="1732000">We</span> <span m="1732610">have</span> <span m="1732810">concluded</span> <span m="1733150">that</span> <span m="1733490">m</span> <span m="1733820">divides</span> <span m="1734350">x.</span> <span m="1734970">And</span> <span m="1735170">also</span> <span m="1735470">m</span> <span m="1735650">divides</span> <span m="1736080">y.</span> </p>
<p><span m="1738980">So</span> <span m="1739290">if</span> <span m="1739420">you</span> <span m="1739510">now</span> <span m="1739720">use</span> <span m="1740720">some</span> <span m="1740960">facts</span> <span m="1741640">about</span> <span m="1742090">divisibility</span> <span m="1742790">on</span> <span m="1742940">your</span> <span m="1743040">handout,</span> <span m="1743800">which</span> <span m="1744720">we</span> <span m="1744870">will</span> <span m="1744970">not</span> <span m="1745200">prove</span> <span m="1745450">now.</span> <span m="1745770">But</span> <span m="1746850">I</span> <span m="1746970">think</span> <span m="1747210">most</span> <span m="1747470">of</span> <span m="1747590">them</span> <span m="1747770">will be</span> <span m="1747850">on</span> <span m="1748080">your</span> <span m="1748140">problem</span> <span m="1748450">set,</span> <span m="1748700">actually.</span> <span m="1750520">We</span> <span m="1750640">can</span> <span m="1750810">conclude</span> <span m="1751280">that</span> <span m="1751510">also</span> <span m="1751920">linear</span> <span m="1752290">combination</span> <span m="1753500">of</span> <span m="1754140">a, b</span> <span m="1755050">x</span> <span m="1755440">and</span> <span m="1755640">y</span> <span m="1756270">will</span> <span m="1756420">be</span> <span m="1756560">divisible</span> <span m="1757210">by</span> <span m="1757460">m.</span> <span m="1758660">In</span> <span m="1758780">particular,</span> <span m="1759320">m</span> <span m="1759570">will</span> <span m="1759840">divide</span> <span m="1759930">x</span> <span m="1760720">plus</span> <span m="1760950">y.</span> <span m="1761850">m</span> <span m="1762330">will</span> <span m="1762580">divide</span> <span m="1763000">x plus</span> <span m="1763170">y</span> <span m="1763280">minus</span> <span m="1763690">a,</span> <span m="1763860">and</span> <span m="1764010">also</span> <span m="1764260">x</span> <span m="1764470">plus</span> <span m="1764650">y,</span> <span m="1764770">minus</span> <span m="1765130">b.</span> </p>
<p><span m="1766400">So</span> <span m="1767680">we</span> <span m="1767830">will</span> <span m="1767980">conclude</span> <span m="1769130">that</span> <span m="1771620">m</span> <span m="1771930">actually</span> <span m="1774040">divides</span> <span m="1774800">any</span> <span m="1775090">possible</span> <span m="1776770">results.</span> <span m="1777960">So</span> <span m="1778480">divides</span> <span m="1778880">any</span> <span m="1779170">of</span> <span m="1779400">the</span> <span m="1779540">above.</span> <span m="1781680">And</span> <span m="1781730">now</span> <span m="1781890">we're</span> <span m="1782030">done.</span> <span m="1784380">Why is</span> <span m="1784740">that?</span> <span m="1785120">Because</span> <span m="1785490">we</span> <span m="1785640">have</span> <span m="1785770">shown</span> <span m="1786220">now that</span> <span m="1786950">after</span> <span m="1787300">the</span> <span m="1787400">next</span> <span m="1787720">transition--</span> <span m="1788510">after</span> <span m="1789430">we</span> <span m="1789810">have</span> <span m="1790210">reached</span> <span m="1790690">x, y</span> <span m="1791740">after n</span> <span m="1791990">steps,</span> <span m="1792870">then</span> <span m="1793020">in</span> <span m="1793160">our</span> <span m="1793530">n</span> <span m="1793740">plus</span> <span m="1793970">1-th</span> <span m="1794250">step,</span> <span m="1796260">all</span> <span m="1796870">that</span> <span m="1797050">you</span> <span m="1797170">can</span> <span m="1797350">achieve</span> <span m="1798980">is</span> <span m="1799250">divisible</span> <span m="1799820">by</span> <span m="1800090">m.</span> <span m="1801180">So</span> <span m="1801300">that's</span> <span m="1801490">exactly</span> <span m="1802030">the</span> <span m="1802250">invariance.</span> <span m="1803810">So</span> <span m="1805000">we</span> <span m="1805130">conclude</span> <span m="1805600">that</span> <span m="1805790">p, n</span> <span m="1806220">plus</span> <span m="1806510">1</span> <span m="1806880">is</span> <span m="1807170">true.</span> <span m="1808620">And</span> <span m="1808640">so</span> <span m="1808790">now</span> <span m="1808980">we're</span> <span m="1809120">done.</span> </p>
<p><span m="1812230">Are any</span> <span m="1812290">questions</span> <span m="1812730">about</span> <span m="1813020">this</span> <span m="1813190">proof?</span> <span m="1814900">So</span> <span m="1815030">this</span> <span m="1815260">is</span> <span m="1815400">like</span> <span m="1815580">the</span> <span m="1815660">standard</span> <span m="1816160">technique</span> <span m="1816540">that</span> <span m="1816730">we</span> <span m="1817100">tried</span> <span m="1817520">to</span> <span m="1817650">use</span> <span m="1817970">all</span> <span m="1818240">the</span> <span m="1818350">time</span> <span m="1818650">here</span> <span m="1818860">in</span> <span m="1818920">this</span> <span m="1819120">class.</span> <span m="1820200">We will</span> <span m="1820420">use it</span> <span m="1820760">in</span> <span m="1821830">all</span> <span m="1821950">the</span> <span m="1822070">other</span> <span m="1822310">areas,</span> <span m="1822600">as</span> <span m="1822770">well.</span> <span m="1822850">In</span> <span m="1823220">graph</span> <span m="1823520">theory, in</span> <span m="1823980">particular.</span> </p>
<p><span m="1826440">And</span> <span m="1828200">especially</span> <span m="1828490">in</span> <span m="1828780">number</span> <span m="1829050">theory,</span> <span m="1829540">will</span> <span m="1829630">also</span> <span m="1829880">use</span> <span m="1830220">it,</span> <span m="1830430">especially</span> <span m="1830860">in</span> <span m="1830930">this</span> <span m="1831140">class.</span> </p>
<p><span m="1833230">OK.</span> <span m="1833720">So</span> <span m="1834670">let's</span> <span m="1834920">apply</span> <span m="1835290">this</span> <span m="1835660">to</span> <span m="1836390">theorem.</span> <span m="1839870">Let's</span> <span m="1840670">I</span> <span m="1840710">think</span> <span m="1841040">about</span> <span m="1842690">this</span> <span m="1843100">movie that</span> <span m="1843340">we</span> <span m="1843410">saw,</span> <span m="1843790">this</span> <span m="1844145"><i>Die</i></span> <span m="1844500"><i>Hard</i></span> <span m="1844880">number</span> <span m="1845110">3.</span> <span m="1846150"><i>Die Hard</i></span> <span m="1846270">number</span> <span m="1846650">4 came</span> <span m="1846960">out.</span> <span m="1848120">And</span> <span m="1848340">then</span> <span m="1849240">the</span> <span m="1849390">cast</span> <span m="1849720">got</span> <span m="1849880">stuck</span> <span m="1850180">in</span> <span m="1850280"><i>Die</i></span> <span m="1850490"><i>Hard</i></span> <span m="1850730">number</span> <span m="1850940">5.</span> <span m="1851890">There's</span> <span m="1852180">was</span> <span m="1852360">a</span> <span m="1852420">problem,</span> <span m="1852910">because</span> <span m="1855036">the</span> <span m="1855520">rumors</span> <span m="1855730">were</span> <span m="1855800">that</span> <span m="1856180">in</span> <span m="1856460"><i>Die Hard</i></span> <span m="1856800">number</span> <span m="1856990">5,</span> <span m="1857460">they</span> <span m="1857630">had</span> <span m="1857890">like</span> <span m="1858190">a</span> <span m="1858750">33</span> <span m="1859560">gallon</span> <span m="1860000">jug.</span> <span m="1861810">That's</span> <span m="1862110">a</span> <span m="1862180">lot.</span> <span m="1862760">And</span> <span m="1862900">a</span> <span m="1862990">55</span> <span m="1863770">gallon</span> <span m="1864090">jug.</span> </p>
<p><span m="1865680">So</span> <span m="1867320">Bruce</span> <span m="1870740">has</span> <span m="1871010">in</span> <span m="1871200">training</span> <span m="1871730">his</span> <span m="1872390">muscles,</span> <span m="1873360">because</span> <span m="1873640">you</span> <span m="1873730">can</span> <span m="1873870">imagine</span> <span m="1874230">those</span> <span m="1874440">are</span> <span m="1874490">pretty</span> <span m="1874730">heavy.</span> <span m="1875210">So</span> <span m="1875340">if</span> <span m="1875480">you</span> <span m="1875560">want</span> <span m="1875670">the</span> <span m="1875760">pour</span> <span m="1875960">one</span> <span m="1876170">into</span> <span m="1876480">the</span> <span m="1876630">other,</span> <span m="1877170">my goodness.</span> <span m="1877560">So--</span> <span m="1879250">but</span> <span m="1879680">the</span> <span m="1879810">question</span> <span m="1880170">is,</span> <span m="1880440">is he training</span> <span m="1880870">the</span> <span m="1880960">right</span> <span m="1881200">muscles?</span> <span m="1882810">So</span> <span m="1883380">can</span> <span m="1883460">we</span> <span m="1883570">apply</span> <span m="1883870">this</span> <span m="1884530">theorem</span> <span m="1884820">now,</span> <span m="1885480">and</span> <span m="1885710">showed</span> <span m="1886100">that--</span> </p>
<p><span m="1887450">Oh,</span> <span m="1888140">I</span> <span m="1888390">should</span> <span m="1888660">to</span> <span m="1888830">tell</span> <span m="1889070">you</span> <span m="1889200">what</span> <span m="1890170">is</span> <span m="1890280">the</span> <span m="1890370">problem.</span> <span m="1891100">Well, again,</span> <span m="1891550">he</span> <span m="1891810">has</span> <span m="1892060">to</span> <span m="1893330">get</span> <span m="1893600">say</span> <span m="1894290">4</span> <span m="1894670">gallons</span> <span m="1895770">out</span> <span m="1895980">of</span> <span m="1896130">this--</span> <span m="1896572">out</span> <span m="1897014">of</span> <span m="1897456">these</span> <span m="1897900">two</span> <span m="1898090">jugs.</span> <span m="1899750">So</span> <span m="1899940">is</span> <span m="1900040">that</span> <span m="1900240">possible?</span> <span m="1902380">It's</span> <span m="1902580">not.</span> <span m="1902760">I</span> <span m="1902800">see</span> <span m="1902980">someone</span> <span m="1903750">shaking</span> <span m="1904160">his head.</span> <span m="1904280">Do</span> <span m="1904860">you</span> <span m="1905040">want</span> <span m="1905150">to</span> <span m="1905210">explain</span> <span m="1905590">why?</span> </p>
<p><span m="1908030">AUDIENCE: A and</span> <span m="1908380">b</span> <span m="1908620">are</span> <span m="1909310">both</span> <span m="1909570">divisible</span> <span m="1910010">by</span> <span m="1910170">11.</span> </p>
<p><span m="1911280">PROFESSOR: Yeah.</span> </p>
<p><span m="1911540">AUDIENCE: So</span> <span m="1911930">any</span> <span m="1912860">other</span> <span m="1913240">configuration</span> <span m="1914100">will</span> <span m="1914320">also</span> <span m="1914640">have to be</span> <span m="1915040">divisible</span> <span m="1915410">by</span> <span m="1915590">11.</span> <span m="1916360">And</span> <span m="1916740">4</span> <span m="1917010">is</span> <span m="1917170">not</span> <span m="1917510">divisible</span> <span m="1917680">by 11.</span> </p>
<p><span m="1918590">PROFESSOR: Exactly.</span> <span m="1919810">4</span> <span m="1919950">is not</span> <span m="1920030">divisible</span> <span m="1920350">by 11,</span> <span m="1920860">so</span> <span m="1921070">the</span> <span m="1921150">whole</span> <span m="1921400">cast got</span> <span m="1921790">blown</span> <span m="1922120">up</span> <span m="1922540">in</span> <span m="1922740"><i>Die Hard</i></span> <span m="1923120">number</span> <span m="1923340">5.</span> <span m="1924310">And so</span> <span m="1924500">we</span> <span m="1924580">have</span> <span m="1924700">no</span> <span m="1924870"><i>Die Hard</i></span> <span m="1925260">number</span> <span m="1925450">6,</span> <span m="1926350">as</span> <span m="1926470">well.</span> </p>
<p><span m="1928510">OK,</span> <span m="1928950">so--</span> <span m="1932120">so</span> <span m="1932320">now</span> <span m="1932550">all</span> <span m="1932790">of</span> <span m="1932890">this</span> <span m="1933070">stuff</span> <span m="1933520">actually</span> <span m="1934420">helps</span> <span m="1934850">us</span> <span m="1935250">to</span> <span m="1935560">define</span> <span m="1936120">a</span> <span m="1936160">new</span> <span m="1936420">concept,</span> <span m="1936960">as</span> <span m="1937100">well.</span> <span m="1937860">So</span> <span m="1938060">let's</span> <span m="1938300">do</span> <span m="1938480">that.</span> <span m="1940580">I'll</span> <span m="1940660">put</span> <span m="1940830">it</span> <span m="1940950">up</span> <span m="1941120">here.</span> </p>
<p></p>
<p><span m="1949630">We</span> <span m="1949760">will</span> <span m="1951050">use</span> <span m="1952070">the</span> <span m="1954570">terminology</span> <span m="1956110">GCD</span> <span m="1960750">of</span> <span m="1961060">a and</span> <span m="1961500">b</span> <span m="1962770">as being</span> <span m="1963540">the</span> <span m="1965050">greatest</span> <span m="1965840">common</span> <span m="1966150">divisor</span> <span m="1974943">of</span> <span m="1976860">a</span> <span m="1977440">and</span> <span m="1978292">b.</span> <span m="1979530">So,</span> <span m="1980380">for</span> <span m="1980610">example,</span> <span m="1981970">if</span> <span m="1982070">we are</span> <span m="1982300">looking</span> <span m="1982650">at</span> <span m="1982880">a</span> <span m="1983140">equals</span> <span m="1983880">3,</span> <span m="1984380">and</span> <span m="1984590">b</span> <span m="1984820">equals</span> <span m="1985170">5,</span> <span m="1986286">well then</span> <span m="1986630">the</span> <span m="1986870">GCD</span> <span m="1988640">of</span> <span m="1989540">3</span> <span m="1989900">and</span> <span m="1990120">5</span> <span m="1991030">is actually equal</span> <span m="1991360">to</span> <span m="1991640">1.</span> <span m="1993360">There's</span> <span m="1993570">no</span> <span m="1993810">other</span> <span m="1995380">larger</span> <span m="1995940">integer</span> <span m="1996570">that</span> <span m="1996720">divides</span> <span m="1997180">both</span> <span m="1997520">3</span> <span m="1997730">and</span> <span m="1997840">5.</span> <span m="2000450">In</span> <span m="2000620">other</span> <span m="2000790">examples</span> <span m="2001530">are,</span> <span m="2001920">for</span> <span m="2002010">example,</span> <span m="2002610">if</span> <span m="2002740">we</span> <span m="2002880">have</span> <span m="2003260">the</span> <span m="2003360">GCD</span> <span m="2004960">of</span> <span m="2005250">say</span> <span m="2006220">52</span> <span m="2006640">and</span> <span m="2007310">44.</span> <span m="2009410">Well,</span> <span m="2009620">what's</span> <span m="2009860">this</span> <span m="2010200">equal</span> <span m="2010560">to?</span> <span m="2011550">Well,</span> <span m="2011800">this</span> <span m="2012100">actually</span> <span m="2012610">is</span> <span m="2012890">4</span> <span m="2013210">times</span> <span m="2014380">13.</span> <span m="2015630">This</span> <span m="2015830">is</span> <span m="2015980">4</span> <span m="2016260">times</span> <span m="2016600">11.</span> <span m="2018170">So</span> <span m="2018470">4</span> <span m="2018800">divides</span> <span m="2019290">both</span> <span m="2019610">this,</span> <span m="2020000">and</span> <span m="2020130">both</span> <span m="2020430">this</span> <span m="2020650">one.</span> <span m="2021350">But</span> <span m="2021520">nothing</span> <span m="2021850">larger</span> <span m="2022380">can</span> <span m="2022560">divide</span> <span m="2022900">both</span> <span m="2023220">of</span> <span m="2023360">those.</span> <span m="2024220">So</span> <span m="2024480">we</span> <span m="2024590">have</span> <span m="2024770">that</span> <span m="2024910">this is</span> <span m="2025190">equal</span> <span m="2025380">to</span> <span m="2025480">4.</span> </p>
<p></p>
<p><span m="2029330">We</span> <span m="2029450">will</span> <span m="2029570">have</span> <span m="2029790">a</span> <span m="2029900">separate</span> <span m="2030310">definition</span> <span m="2032110">that</span> <span m="2032290">talks</span> <span m="2032760">about</span> <span m="2033120">this</span> <span m="2033290">very</span> <span m="2033450">special</span> <span m="2034040">case</span> <span m="2034540">where</span> <span m="2034650">two</span> <span m="2034850">numbers--</span> <span m="2036270">if</span> <span m="2036400">you</span> <span m="2036510">look</span> <span m="2036670">at</span> <span m="2036740">their</span> <span m="2036890">greatest</span> <span m="2037230">common</span> <span m="2037430">divisor--</span> <span m="2039630">when</span> <span m="2039820">that</span> <span m="2040740">greatest</span> <span m="2041060">common</span> <span m="2041240">divisor</span> <span m="2041570">is</span> <span m="2041690">equal</span> <span m="2041950">to</span> <span m="2042080">1,</span> <span m="2042445">we</span> <span m="2042810">actually</span> <span m="2043090">define</span> <span m="2043520">those</span> <span m="2043740">two</span> <span m="2043880">numbers</span> <span m="2044240">to</span> <span m="2044350">be</span> <span m="2044520">relatively</span> <span m="2045130">prime</span> <span m="2045600">to</span> <span m="2045740">one</span> <span m="2045890">another.</span> <span m="2048310">So</span> <span m="2048630">let's</span> <span m="2048949">put</span> <span m="2049350">that</span> <span m="2049610">out</span> <span m="2050210">over</span> <span m="2050550">here.</span> </p>
<p></p>
<p></p>
<p><span m="2060550">So</span> <span m="2060730">that's</span> <span m="2060940">another</span> <span m="2061210">definition.</span> <span m="2063630">We</span> <span m="2063719">say</span> <span m="2064480">that</span> <span m="2064830">a and</span> <span m="2066679">b</span> <span m="2067840">are</span> <span m="2068250">relatively</span> <span m="2068929">prime</span> <span m="2075040">if</span> <span m="2076130">the</span> <span m="2076300">greatest</span> <span m="2076770">common</span> <span m="2076989">divisor</span> <span m="2078400">is</span> <span m="2078639">actually</span> <span m="2078949">equal</span> <span m="2079199">to</span> <span m="2079340">1.</span> </p>
<p></p>
<p><span m="2082840">Now</span> <span m="2083060">today</span> <span m="2083335">we</span> <span m="2083610">will</span> <span m="2083780">not</span> <span m="2083989">really</span> <span m="2084199">use his</span> <span m="2084570">definition</span> <span m="2085080">so</span> <span m="2085320">much,</span> <span m="2085810">but</span> <span m="2086000">it's</span> <span m="2086409">actually</span> <span m="2086659">very</span> <span m="2086940">important.</span> <span m="2087510">And we'll</span> <span m="2087620">come</span> <span m="2087929">back</span> <span m="2088139">to</span> <span m="2088270">this</span> <span m="2088780">next</span> <span m="2089239">lecture.</span> </p>
<p></p>
<p><span m="2093520">So</span> <span m="2094730">if</span> <span m="2094920">we</span> <span m="2095060">now</span> <span m="2095260">look</span> <span m="2095489">at</span> <span m="2095580">this</span> <span m="2095739">particular</span> <span m="2096100">thing</span> <span m="2096420">them</span> <span m="2096600">over</span> <span m="2096860">here,</span> <span m="2098480">can</span> <span m="2098620">we</span> <span m="2098740">see</span> <span m="2099370">a</span> <span m="2100070">nice</span> <span m="2101130">corollary of this?</span> <span m="2102490">Like a</span> <span m="2102670">result,</span> <span m="2103170">if</span> <span m="2103300">you</span> <span m="2103410">think</span> <span m="2103650">about</span> <span m="2103920">this</span> <span m="2104070">greatest</span> <span m="2104460">common</span> <span m="2104670">divisor.</span> <span m="2106160">Well,</span> <span m="2106360">the</span> <span m="2106430">greatest</span> <span m="2106880">common</span> <span m="2107130">divisor</span> <span m="2107720">off</span> <span m="2108070">a an</span> <span m="2108560">b</span> <span m="2109200">divides</span> <span m="2109690">both</span> <span m="2110090">a and</span> <span m="2110730">b.</span> <span m="2111670">So</span> <span m="2111840">the</span> <span m="2111940">greatest</span> <span m="2112260">common</span> <span m="2112580">divisor</span> <span m="2112930">of a</span> <span m="2113130">and</span> <span m="2113470">b</span> <span m="2114080">will divide</span> <span m="2114510">any result</span> <span m="2115340">that</span> <span m="2115500">we</span> <span m="2115590">can</span> <span m="2116690">generate</span> <span m="2118330">by</span> <span m="2118620">playing</span> <span m="2118930">this</span> <span m="2119130">game</span> <span m="2119550">with the jugs.</span> <span m="2120650">So</span> <span m="2120860">the</span> <span m="2120960">corollary</span> <span m="2121590">here</span> <span m="2122730">is</span> <span m="2123850">that</span> <span m="2124640">the</span> <span m="2124770">GCD</span> <span m="2126540">of a</span> <span m="2126880">and</span> <span m="2127410">b</span> <span m="2128060">divides</span> <span m="2128870">any</span> <span m="2129810">result.</span> </p>
<p></p>
<p><span m="2134440">OK,</span> <span m="2134880">so</span> <span m="2135090">that's</span> <span m="2135330">really</span> <span m="2135570">cool.</span> <span m="2137200">So</span> <span m="2137380">this</span> <span m="2137690">already</span> <span m="2138490">tells</span> <span m="2138720">us</span> <span m="2139070">quite</span> <span m="2139380">a</span> <span m="2139430">bit</span> <span m="2139970">about</span> <span m="2140290">this</span> <span m="2140700">game</span> <span m="2140950">that we</span> <span m="2141130">have</span> <span m="2141490">here.</span> <span m="2142590">So</span> <span m="2142720">now</span> <span m="2143110">what</span> <span m="2143460">we</span> <span m="2143720">would</span> <span m="2143820">like</span> <span m="2144000">to</span> <span m="2144120">do</span> <span m="2144410">is</span> <span m="2144700">to</span> <span m="2145510">find</span> <span m="2145880">out</span> <span m="2146830">what</span> <span m="2147130">exactly</span> <span m="2147600">we</span> <span m="2147740">can</span> <span m="2147930">be</span> <span m="2148120">reached?</span> <span m="2149050">We</span> <span m="2149370">have a</span> <span m="2149460">property</span> <span m="2149930">that we have</span> <span m="2150300">shown</span> <span m="2150700">here.</span> <span m="2151760">But</span> <span m="2153230">what</span> <span m="2153410">else</span> <span m="2153660">can</span> <span m="2153820">we</span> <span m="2153930">do</span> <span m="2154170">here?</span> </p>
<p><span m="2155300">Now</span> <span m="2155440">it</span> <span m="2155520">turns</span> <span m="2155870">out</span> <span m="2156590">that</span> <span m="2156750">you</span> <span m="2156850">can</span> <span m="2157010">say</span> <span m="2157730">much</span> <span m="2157980">more,</span> <span m="2158640">and</span> <span m="2158790">we</span> <span m="2158900">would</span> <span m="2159020">like</span> <span m="2159190">to</span> <span m="2159310">prove</span> <span m="2159510">the</span> <span m="2159590">following</span> <span m="2159930">theorem</span> <span m="2161600">to</span> <span m="2161770">make--</span> <span m="2163330">to</span> <span m="2163690">analyze</span> <span m="2164170">this</span> <span m="2164320">whole</span> <span m="2164520">thing</span> <span m="2164720">much</span> <span m="2164960">better.</span> <span m="2165920">I</span> <span m="2166000">don't</span> <span m="2166210">think</span> <span m="2166420">I</span> <span m="2166460">need</span> <span m="2166660">the</span> <span m="2166730">state</span> <span m="2167450">machine</span> <span m="2167860">anymore.</span> <span m="2169400">So</span> <span m="2169560">let's</span> <span m="2169910">take that</span> <span m="2170230">off.</span> </p>
<p></p>
<p><span m="2179810">The</span> <span m="2179900">theorem</span> <span m="2180190">that</span> <span m="2180290">we</span> <span m="2180600">would</span> <span m="2180720">like</span> <span m="2180910">to</span> <span m="2181010">prove</span> <span m="2181580">is</span> <span m="2182810">that</span> <span m="2184630">any</span> <span m="2184990">linear</span> <span m="2185410">combination</span> <span m="2186680">of</span> <span m="2188390">the--</span> <span m="2188820">let's change</span> <span m="2189225">this</span> <span m="2189630">into</span> <span m="2190530">the 3 and 5 again.</span> <span m="2192210">Any</span> <span m="2192410">linear</span> <span m="2192750">combination</span> <span m="2193570">of</span> <span m="2193880">3</span> <span m="2194220">and</span> <span m="2194400">5,</span> <span m="2195180">I</span> <span m="2196870">can</span> <span m="2197080">make</span> <span m="2197480">with</span> <span m="2197680">these</span> <span m="2198090">3</span> <span m="2198550">and</span> <span m="2198660">the</span> <span m="2198740">5</span> <span m="2199890">a</span> <span m="2199990">gallon</span> <span m="2200320">jug.</span> <span m="2201280">So</span> <span m="2201480">let's</span> <span m="2201670">write</span> <span m="2201850">it</span> <span m="2201980">out.</span> <span m="2202660">So</span> <span m="2205590">any</span> <span m="2206290">linear</span> <span m="2206720">combination</span> <span m="2214470">l,</span> <span m="2215460">which</span> <span m="2215680">we</span> <span m="2215820">writes</span> <span m="2216170">as</span> <span m="2217430">some</span> <span m="2217730">integer</span> <span m="2218280">s</span> <span m="2218590">times</span> <span m="2219040">a,</span> <span m="2219960">plus some</span> <span m="2220810">integer</span> <span m="2221330">t</span> <span m="2221660">times</span> <span m="2222060">b.</span> <span m="2225170">So</span> <span m="2225430">any</span> <span m="2225630">linear</span> <span m="2225920">combination</span> <span m="2227400">of</span> <span m="2227700">a</span> <span m="2228000">and</span> <span m="2228910">b,</span> <span m="2233690">with--</span> <span m="2235080">well,</span> <span m="2235320">of</span> <span m="2235490">course,</span> <span m="2235760">the</span> <span m="2235860">number</span> <span m="2236060">of gallons</span> <span m="2236300">should</span> <span m="2236500">fit</span> <span m="2237470">the</span> <span m="2237570">largest</span> <span m="2238200">the</span> <span m="2238920">jug.</span> <span m="2239850">So</span> <span m="2241350">with</span> <span m="2241720">0</span> <span m="2242035">is,</span> <span m="2243950">at</span> <span m="2244120">most</span> <span m="2244460">l.</span> <span m="2245430">Is it</span> <span m="2245570">mostly</span> <span m="2246940">can</span> <span m="2247150">be</span> <span m="2247310">reached.</span> </p>
<p></p>
<p><span m="2254520">So</span> <span m="2254700">this</span> <span m="2255270">theorem</span> <span m="2256130">we</span> <span m="2256260">would</span> <span m="2256370">like</span> <span m="2256550">to</span> <span m="2256640">prove</span> <span m="2256950">now.</span> <span m="2257920">And</span> <span m="2258400">in</span> <span m="2258560">order</span> <span m="2258700">to</span> <span m="2258840">do</span> <span m="2259040">that,</span> <span m="2259400">we</span> <span m="2259460">would</span> <span m="2259610">like</span> <span m="2259840">to</span> <span m="2261010">already</span> <span m="2262420">think</span> <span m="2262680">about</span> <span m="2263070">some</span> <span m="2263230">kind</span> <span m="2263410">of a</span> <span m="2263580">property</span> <span m="2264260">that</span> <span m="2264440">we</span> <span m="2264550">have.</span> <span m="2265250">So</span> <span m="2265480">when</span> <span m="2265640">we</span> <span m="2265750">talk</span> <span m="2265940">about</span> <span m="2266090">linear</span> <span m="2266400">combinations,</span> <span m="2267780">the</span> <span m="2268260">s and the</span> <span m="2268470">t</span> <span m="2269090">can</span> <span m="2269240">be</span> <span m="2269340">negative,</span> <span m="2269900">or</span> <span m="2269950">positive.</span> <span m="2270820">We</span> <span m="2270910">really</span> <span m="2271130">don't</span> <span m="2271420">care.</span> <span m="2271760">So</span> <span m="2271780">for</span> <span m="2271950">example,</span> <span m="2273140">we</span> <span m="2273170">could</span> <span m="2273360">have</span> <span m="2273680">like,</span> <span m="2274110">I don't</span> <span m="2274730">know,</span> <span m="2276560">minus</span> <span m="2277000">2</span> <span m="2277320">times--</span> <span m="2278070">so</span> <span m="2278230">for</span> <span m="2278330">example,</span> <span m="2278720">4</span> <span m="2279360">is</span> <span m="2279560">equal</span> <span m="2279810">to</span> <span m="2279930">minus</span> <span m="2280380">2,</span> <span m="2280920">times</span> <span m="2281750">3,</span> <span m="2282820">plus--</span> <span m="2285130">actually, is</span> <span m="2285515">that</span> <span m="2285900">true?</span> <span m="2286140">Yeah.</span> <span m="2286820">Plus</span> <span m="2287430">2,</span> <span m="2287640">times</span> <span m="2289170">5.</span> <span m="2290590">So</span> <span m="2290930">here</span> <span m="2291170">we</span> <span m="2291320">have</span> <span m="2293020">s</span> <span m="2293410">to</span> <span m="2293620">be</span> <span m="2293720">equal</span> <span m="2293950">to</span> <span m="2294070">minus</span> <span m="2294460">2,</span> <span m="2295490">and</span> <span m="2295800">t</span> <span m="2297030">is</span> <span m="2297200">equal</span> <span m="2297460">to</span> <span m="2297650">2.</span> <span m="2298710">And</span> <span m="2298870">of</span> <span m="2299000">course,</span> <span m="2299260">a is</span> <span m="2299580">equal</span> <span m="2299790">to</span> <span m="2299900">3,</span> <span m="2300190">right?</span> <span m="2300430">And</span> <span m="2300490">be</span> <span m="2301540">is</span> <span m="2301720">equal</span> <span m="2301960">to</span> <span m="2302080">5.</span> <span m="2303210">So</span> <span m="2304720">4 is</span> <span m="2305100">a</span> <span m="2305240">linear</span> <span m="2305540">combination</span> <span m="2306100">of</span> <span m="2306240">these</span> <span m="2306450">two.</span> <span m="2307160">And</span> <span m="2307400">according</span> <span m="2307690">to</span> <span m="2307810">the</span> <span m="2307990">theorem,</span> <span m="2308890">we</span> <span m="2309060">can</span> <span m="2310190">create</span> <span m="2310600">that</span> <span m="2310790">number</span> <span m="2311070">of</span> <span m="2311250">gallons</span> <span m="2312040">in</span> <span m="2312190">this</span> <span m="2312380">jug.</span> <span m="2313280">And</span> <span m="2313440">we</span> <span m="2313530">already</span> <span m="2313800">saw</span> <span m="2314090">that,</span> <span m="2314260">because</span> <span m="2314570">we</span> <span m="2314650">did</span> <span m="2314840">it.</span> </p>
<p><span m="2316480">But</span> <span m="2318222">for</span> <span m="2318570">our</span> <span m="2318800">theorem,</span> <span m="2319210">in order</span> <span m="2319460">to</span> <span m="2319590">prove</span> <span m="2320000">this,</span> <span m="2320430">we</span> <span m="2320810">really would</span> <span m="2320970">like</span> <span m="2321340">s</span> <span m="2321520">to</span> <span m="2321610">be</span> <span m="2321770">positive.</span> <span m="2323020">So</span> <span m="2323160">how</span> <span m="2323310">can</span> <span m="2323430">we</span> <span m="2323540">do</span> <span m="2323700">that?</span> <span m="2325390">If</span> <span m="2325490">anybody</span> <span m="2325830">has</span> <span m="2326020">an</span> <span m="2326140">indea what</span> <span m="2326420">we</span> <span m="2326680">could</span> <span m="2326830">do?</span> </p>
<p><span m="2328150">AUDIENCE: Let's</span> <span m="2328650">assume that b</span> <span m="2329150">is</span> <span m="2329500">greater</span> <span m="2329860">than</span> <span m="2330010">m.</span> </p>
<p><span m="2331420">PROFESSOR: Yeah.</span> <span m="2331890">We have</span> <span m="2332360">still that</span> <span m="2332830">a is</span> <span m="2333300">supposed to</span> <span m="2333770">be--</span> <span m="2334240">We will</span> <span m="2334710">assume</span> <span m="2335180">that</span> <span m="2336160">throughout</span> <span m="2336490">the</span> <span m="2336550">whole</span> <span m="2337490">lecture.</span> <span m="2337870">Thanks.</span> </p>
<p></p>
<p><span m="2340880">So</span> <span m="2340980">in order to</span> <span m="2341310">prove</span> <span m="2341830">this, we</span> <span m="2341990">really</span> <span m="2342230">would</span> <span m="2342410">like</span> <span m="2342650">to</span> <span m="2342780">have</span> <span m="2342990">s</span> <span m="2343210">to</span> <span m="2343360">be</span> <span m="2343520">positive.</span> <span m="2344110">So</span> <span m="2344180">let's</span> <span m="2344580">just</span> <span m="2344840">play</span> <span m="2345010">around</span> <span m="2345490">a</span> <span m="2345530">little</span> <span m="2345720">bit</span> <span m="2345940">with</span> <span m="2346040">linear</span> <span m="2346320">combinations</span> <span m="2347050">to</span> <span m="2347190">get</span> <span m="2347360">a</span> <span m="2347390">little</span> <span m="2347560">bit</span> <span m="2347700">of</span> <span m="2347830">feeling</span> <span m="2348260">for</span> <span m="2348500">that.</span> <span m="2349280">How</span> <span m="2349440">could</span> <span m="2349640">we</span> <span m="2350120">write</span> <span m="2350480">4</span> <span m="2350800">differently,</span> <span m="2351510">as</span> <span m="2351680">a</span> <span m="2351730">linear</span> <span m="2352030">combination</span> <span m="2352630">of</span> <span m="2352740">3 and 5,</span> <span m="2354150">such</span> <span m="2354520">that</span> <span m="2355370">we</span> <span m="2355500">have</span> <span m="2356050">actually</span> <span m="2356570">a</span> <span m="2356670">positive</span> <span m="2357100">number</span> <span m="2357480">over</span> <span m="2357860">here?</span> <span m="2359150">Does</span> <span m="2359260">anybody see</span> <span m="2359610">another</span> <span m="2360020">way</span> <span m="2360150">to</span> <span m="2361920">see</span> <span m="2362350">that?</span> </p>
<p><span m="2363895">AUDIENCE: [INAUDIBLE]</span> </p>
<p><span m="2366170">PROFESSOR: Yeah,</span> <span m="2366630">that's</span> <span m="2366950">true. 3</span> <span m="2367340">times</span> <span m="2367590">3,</span> <span m="2367840">minus--</span> <span m="2369940">minus</span> <span m="2370280">5.</span> <span m="2371270">So--</span> <span m="2372200">and</span> <span m="2372370">how</span> <span m="2372660">did</span> <span m="2372810">we</span> <span m="2372980">do that?</span> <span m="2373460">Well,</span> <span m="2373660">we</span> <span m="2373800">can</span> <span m="2374010">just</span> <span m="2374770">say</span> <span m="2375580">5</span> <span m="2376090">times</span> <span m="2376560">3</span> <span m="2377630">to</span> <span m="2377770">this</span> <span m="2378030">one,</span> <span m="2378580">and then</span> <span m="2378810">subtract</span> <span m="2379320">the</span> <span m="2379400">same</span> <span m="2379760">again,</span> <span m="2380850">minus</span> <span m="2381160">3</span> <span m="2381390">times</span> <span m="2381820">5,</span> <span m="2382090">over</span> <span m="2382390">here.</span> <span m="2383320">And</span> <span m="2383570">if</span> <span m="2383700">he</span> <span m="2383880">adds</span> <span m="2384260">those</span> <span m="2384560">things</span> <span m="2384830">together,</span> <span m="2386170">he</span> <span m="2386330">will</span> <span m="2386440">see</span> <span m="2386860">5</span> <span m="2387340">minus</span> <span m="2387760">2,</span> <span m="2388490">is</span> <span m="2388720">3</span> <span m="2388960">times</span> <span m="2389280">3,</span> <span m="2389550">as you</span> <span m="2389990">said.</span> <span m="2390870">And</span> <span m="2391670">we</span> <span m="2391780">have</span> <span m="2392010">minus</span> <span m="2392430">3</span> <span m="2392650">plus</span> <span m="2392910">2</span> <span m="2393180">is actually</span> <span m="2393510">minus</span> <span m="2393950">1</span> <span m="2394520">times</span> <span m="2394990">5.</span> <span m="2395580">And</span> <span m="2395720">this</span> <span m="2395890">will</span> <span m="2395990">be a</span> <span m="2396140">different</span> <span m="2396620">linear</span> <span m="2396930">combination</span> <span m="2397530">of</span> <span m="2397640">4.</span> </p>
<p><span m="2398900">So</span> <span m="2399070">what</span> <span m="2399220">we</span> <span m="2399300">can</span> <span m="2399460">do</span> <span m="2399660">here,</span> <span m="2399930">we</span> <span m="2400040">can</span> <span m="2400200">sort</span> <span m="2400390">of</span> <span m="2400480">play</span> <span m="2400730">around</span> <span m="2401640">and</span> <span m="2402450">make</span> <span m="2402930">this</span> <span m="2402990">s</span> <span m="2403490">over</span> <span m="2403780">here,</span> <span m="2404090">which</span> <span m="2404450">we now</span> <span m="2404920">say</span> <span m="2405295">call s</span> <span m="2405670">prime,</span> <span m="2406740">is</span> <span m="2406900">positive.</span> </p>
<p></p>
<p><span m="2410200">Actually,</span> <span m="2410600">it's</span> <span m="2410790">larger</span> <span m="2411080">than</span> <span m="2411370">0.</span> </p>
<p></p>
<p><span m="2417340">So</span> <span m="2418180">let's</span> <span m="2419420">start</span> <span m="2420070">the proof</span> <span m="2420540">for</span> <span m="2420780">this</span> <span m="2421280">theorem.</span> <span m="2422960">It's</span> <span m="2423120">pretty</span> <span m="2426550">amazing</span> <span m="2427010">to</span> <span m="2427160">me,</span> <span m="2427320">actually,</span> <span m="2427595">that</span> <span m="2427870">you</span> <span m="2427990">can</span> <span m="2428190">do</span> <span m="2428330">so</span> <span m="2428530">much</span> <span m="2430090">a game</span> <span m="2430420">like</span> <span m="2430650">this,</span> <span m="2431470">and</span> <span m="2431920">see</span> <span m="2432180">so</span> <span m="2432380">much</span> <span m="2432650">happening.</span> <span m="2435020">So</span> <span m="2435160">let's</span> <span m="2436420">figure</span> <span m="2436780">out</span> <span m="2437790">how</span> <span m="2437950">this</span> <span m="2438140">works.</span> <span m="2440700">OK.</span> </p>
<p></p>
<p><span m="2445300">So</span> <span m="2445510">let's</span> <span m="2445950">first</span> <span m="2446290">formalize</span> <span m="2447310">this</span> <span m="2448040">particular</span> <span m="2448560">trick</span> <span m="2448860">over</span> <span m="2449170">here.</span> <span m="2451850">And</span> <span m="2452020">how</span> <span m="2452130">do</span> <span m="2452240">we</span> <span m="2452350">go</span> <span m="2452580">ahead</span> <span m="2452860">with</span> <span m="2453060">it?</span> <span m="2454030">Ah,</span> <span m="2454490">well,</span> <span m="2455810">notice</span> <span m="2458270">that</span> <span m="2459000">we</span> <span m="2459130">can</span> <span m="2459330">rewrite</span> <span m="2459990">L,</span> <span m="2460800">which</span> <span m="2460920">is</span> <span m="2461060">equal</span> <span m="2461410">to</span> <span m="2462160">s</span> <span m="2462570">times</span> <span m="2463040">a, plus</span> <span m="2463720">t</span> <span m="2464010">times</span> <span m="2464440">b.</span> <span m="2465780">s,</span> <span m="2467600">you</span> <span m="2468055">know,</span> <span m="2469010">we</span> <span m="2469160">can</span> <span m="2469330">just</span> <span m="2469790">add</span> <span m="2470730">a</span> <span m="2470820">multiple</span> <span m="2471160">of</span> <span m="2471500">b</span> <span m="2471930">over</span> <span m="2472050">here.</span> <span m="2473130">n</span> <span m="2473320">times</span> <span m="2473640">b, say m</span> <span m="2475110">times</span> <span m="2475650">a.</span> <span m="2476880">And</span> <span m="2477080">we</span> <span m="2477220">can</span> <span m="2477460">subtract</span> <span m="2478350">the</span> <span m="2478470">same</span> <span m="2479510">amount</span> <span m="2480540">over</span> <span m="2480830">here,</span> <span m="2482140">minus</span> <span m="2482570">n</span> <span m="2482780">times</span> <span m="2483150">a,</span> <span m="2483480">times</span> <span m="2483780">b.</span> <span m="2484370">So</span> <span m="2485120">do you see</span> <span m="2485450">what</span> <span m="2485620">I</span> <span m="2485790">did</span> <span m="2486030">over</span> <span m="2486270">here?</span> <span m="2486530">I have</span> <span m="2486740">added</span> <span m="2487090">n</span> <span m="2487310">times</span> <span m="2487530">b,</span> <span m="2487770">times</span> <span m="2488130">a,</span> <span m="2488660">and</span> <span m="2488810">subtracted</span> <span m="2489450">n,</span> <span m="2489710">times</span> <span m="2489960">a</span> <span m="2490280">times</span> <span m="2490570">b.</span> <span m="2492760">And</span> <span m="2492920">we</span> <span m="2493000">did</span> <span m="2493180">something</span> <span m="2493610">similar</span> <span m="2494050">over</span> <span m="2494360">here,</span> <span m="2494500">not</span> <span m="2494700">exactly</span> <span m="2495140">the</span> <span m="2495220">same.</span> <span m="2495750">But</span> <span m="2496040">that's</span> <span m="2496650">what</span> <span m="2496820">we</span> <span m="2496900">did.</span> </p>
<p><span m="2497990">And</span> <span m="2500160">you</span> <span m="2500310">can</span> <span m="2500440">imagine</span> <span m="2500920">that</span> <span m="2501030">we</span> <span m="2501140">can</span> <span m="2501330">choose</span> <span m="2501700">m,</span> <span m="2502390">such</span> <span m="2502820">that</span> <span m="2503300">s</span> <span m="2503580">plus</span> <span m="2503830">n</span> <span m="2504090">times</span> <span m="2504390">b</span> <span m="2504750">will</span> <span m="2504910">be</span> <span m="2505175">larger than</span> <span m="2505440">0.</span> <span m="2505970">We</span> <span m="2506090">can</span> <span m="2506220">do</span> <span m="2506340">that.</span> <span m="2507030">So</span> <span m="2507490">essentially</span> <span m="2508020">this</span> <span m="2509130">proved</span> <span m="2509600">to</span> <span m="2509780">us</span> <span m="2510800">that</span> <span m="2511220">there</span> <span m="2511450">exists</span> <span m="2512290">an</span> <span m="2512490">x</span> <span m="2512770">prime,</span> <span m="2513450">and</span> <span m="2513640">also</span> <span m="2513850">the</span> <span m="2513970">t</span> <span m="2514190">prime,</span> <span m="2515360">such</span> <span m="2515730">that</span> <span m="2516030">L</span> <span m="2517050">can</span> <span m="2517250">be</span> <span m="2517420">rewritten</span> <span m="2518110">as</span> <span m="2518310">a</span> <span m="2518360">linear</span> <span m="2518710">combination,</span> <span m="2519610">s</span> <span m="2519880">prime,</span> <span m="2520210">times</span> <span m="2520690">a,</span> <span m="2521442">plus</span> <span m="2521820">t</span> <span m="2522050">prime,</span> <span m="2522550">times</span> <span m="2523740">b.</span> <span m="2524600">But</span> <span m="2524750">now</span> <span m="2524930">with</span> <span m="2525110">you</span> <span m="2525200">extra</span> <span m="2525500">property,</span> <span m="2527500">that</span> <span m="2528060">s</span> <span m="2528300">prime</span> <span m="2528710">is</span> <span m="2530950">actually</span> <span m="2531340">positive.</span> </p>
<p><span m="2533010">Now</span> <span m="2533190">this</span> <span m="2533380">is</span> <span m="2533560">really</span> <span m="2534250">important,</span> <span m="2535100">because</span> <span m="2535540">we're</span> <span m="2535690">going</span> <span m="2535920">to</span> <span m="2536090">create</span> <span m="2536440">an</span> <span m="2536620">algorithm</span> <span m="2538450">of</span> <span m="2538590">playing</span> <span m="2538840">with</span> <span m="2539020">those</span> <span m="2539240">jugs</span> <span m="2539980">that</span> <span m="2540230">can</span> <span m="2541130">achieve</span> <span m="2541640">this</span> <span m="2541770">particular</span> <span m="2542130">linear</span> <span m="2542410">combination.</span> <span m="2543280">And</span> <span m="2543300">that's</span> <span m="2543450">how</span> <span m="2543620">we're</span> <span m="2543730">going</span> <span m="2543910">to</span> <span m="2544030">prove</span> <span m="2544320">this</span> <span m="2544500">theorem.</span> <span m="2546700">So</span> <span m="2547840">let's</span> <span m="2548070">assume</span> <span m="2551310">that</span> <span m="2551920">0</span> <span m="2553540">is</span> <span m="2553880">less</span> <span m="2554380">than</span> <span m="2554640">L,</span> <span m="2555030">is</span> <span m="2555240">less</span> <span m="2555530">than</span> <span m="2555720">b.</span> <span m="2556215">I</span> <span m="2556710">know</span> <span m="2557040">that</span> <span m="2557310">we,</span> <span m="2557700">in the</span> <span m="2558450">theorem,</span> <span m="2559190">we</span> <span m="2559410">also</span> <span m="2559690">consider</span> <span m="2559990">the</span> <span m="2560120">case is</span> <span m="2560540">L</span> <span m="2560770">equals</span> <span m="2561130">0, and</span> <span m="2561580">L</span> <span m="2561800">equals</span> <span m="2562190">b.</span> <span m="2562570">But</span> <span m="2562680">those</span> <span m="2562950">are obvious,</span> <span m="2563440">right?</span> <span m="2563680">You</span> <span m="2563730">could</span> <span m="2563860">either</span> <span m="2564090">empty the</span> <span m="2564530">jugs,</span> <span m="2565540">or</span> <span m="2565700">just</span> <span m="2566020">fill</span> <span m="2566190">up</span> <span m="2566450">with</span> <span m="2567580">the</span> <span m="2567670">bigger</span> <span m="2567920">one.</span> <span m="2569130">So</span> <span m="2569730">we</span> <span m="2569840">will</span> <span m="2570020">consider</span> <span m="2570370">just</span> <span m="2570630">this</span> <span m="2570890">case.</span> </p>
<p></p>
<p><span m="2574650">All</span> <span m="2574790">right.</span> <span m="2575080">So</span> <span m="2575250">what's</span> <span m="2575440">the</span> <span m="2575550">algorithm</span> <span m="2576020">going</span> <span m="2576280">to</span> <span m="2576410">do</span> <span m="2576590">for</span> <span m="2576750">us?</span> </p>
<p></p>
<p><span m="2583159">The</span> <span m="2583660">algorithm</span> <span m="2590320">is</span> <span m="2590520">going</span> <span m="2590810">to</span> <span m="2591190">repeatedly</span> <span m="2591890">fill</span> <span m="2592310">and</span> <span m="2592430">pour</span> <span m="2592740">our</span> <span m="2592900">jugs</span> <span m="2594120">in</span> <span m="2594250">a</span> <span m="2594360">very</span> <span m="2594530">special</span> <span m="2595040">way.</span> <span m="2596160">And</span> <span m="2596540">miraculously</span> <span m="2597380">we</span> <span m="2597850">will</span> <span m="2597990">be</span> <span m="2598170">able</span> <span m="2599040">to</span> <span m="2600000">get</span> <span m="2600470">the desired</span> <span m="2600865">linear</span> <span m="2601260">combination</span> <span m="2602420">every</span> <span m="2602760">single</span> <span m="2603120">time.</span> <span m="2606270">And</span> <span m="2606450">of</span> <span m="2606590">course,</span> <span m="2606780">we're</span> <span m="2606880">going</span> <span m="2607080">to</span> <span m="2607220">use</span> <span m="2607460">induction</span> <span m="2607890">again</span> <span m="2608270">to</span> <span m="2608400">prove</span> <span m="2608650">this</span> <span m="2609220">property.</span> </p>
<p><span m="2610840">OK.</span> <span m="2611110">So</span> <span m="2611260">how</span> <span m="2611400">does</span> <span m="2611490">the</span> <span m="2611820">algorithm</span> <span m="2612130">work?</span> <span m="2613330">Well,</span> <span m="2613530">to</span> <span m="2613690">obtain</span> <span m="2617140">L gallons</span> <span m="2622360">we're</span> <span m="2622560">going</span> <span m="2622800">to</span> <span m="2622920">repeat</span> <span m="2625980">s</span> <span m="2626240">prime</span> <span m="2626590">times,</span> <span m="2627350">which</span> <span m="2627580">is</span> <span m="2628440">the</span> <span m="2628600">number</span> <span m="2628990">that we</span> <span m="2629450">have over</span> <span m="2629580">here.</span> <span m="2633320">The</span> <span m="2633420">following</span> <span m="2636590">algorithm--</span> <span m="2637960">we</span> <span m="2638100">first</span> <span m="2638400">of all,</span> <span m="2640260">we</span> <span m="2640370">will</span> <span m="2640590">fill</span> <span m="2641210">the a</span> <span m="2641685">jug.</span> <span m="2646800">This</span> <span m="2647030">one.</span> <span m="2648830">After</span> <span m="2648910">we</span> <span m="2649060">have</span> <span m="2649200">done</span> <span m="2649400">this,</span> <span m="2649830">we are going</span> <span m="2650150">to</span> <span m="2650290">pour</span> <span m="2650590">this</span> <span m="2650750">into</span> <span m="2651010">the b</span> <span m="2651310">jug.</span> <span m="2652380">So</span> <span m="2653070">how</span> <span m="2653445">do</span> <span m="2653900">we</span> <span m="2654010">go</span> <span m="2654260">ahead?</span> <span m="2655090">We</span> <span m="2655190">pour-</span> <span m="2657190">oops.</span> <span m="2658470">This</span> <span m="2658660">into</span> <span m="2659030">the</span> <span m="2659150">b</span> <span m="2659320">jug.</span> </p>
<p></p>
<p><span m="2663450">And</span> <span m="2665030">when</span> <span m="2666030">this</span> <span m="2666230">b jug</span> <span m="2667030">becomes</span> <span m="2667390">full,</span> <span m="2667790">we are going</span> <span m="2668220">pour</span> <span m="2668460">it</span> <span m="2668540">out.</span> <span m="2668960">So</span> <span m="2669170">let's</span> <span m="2669440">write</span> <span m="2669630">it</span> <span m="2669730">out.</span> <span m="2671040">So</span> <span m="2671320">when</span> <span m="2675290">it</span> <span m="2675490">becomes</span> <span m="2679460">full,</span> <span m="2681010">it</span> <span m="2681130">will</span> <span m="2681320">actually</span> <span m="2684210">empty</span> <span m="2684490">it</span> <span m="2684780">out.</span> <span m="2689080">And</span> <span m="2689450">we will</span> <span m="2689720">continue</span> <span m="2690380">pouring</span> <span m="2691450">the a</span> <span m="2691640">jug</span> <span m="2692150">into</span> <span m="2692420">the</span> <span m="2692500">b jug.</span> <span m="2693610">So</span> <span m="2693850">we'll</span> <span m="2695160">continue</span> <span m="2695620">this</span> <span m="2695830">process.</span> </p>
<p></p>
<p><span m="2700120">So</span> <span m="2700360">let's</span> <span m="2700980">take</span> <span m="2701260">an</span> <span m="2701320">example</span> <span m="2701950">to</span> <span m="2702050">see</span> <span m="2702250">how</span> <span m="2702380">that</span> <span m="2702560">works.</span> <span m="2704060">So</span> <span m="2704420">we</span> <span m="2705310">keep</span> <span m="2705580">on</span> <span m="2705700">doing</span> <span m="2706010">this</span> <span m="2706490">until</span> <span m="2708000">the</span> <span m="2708210">a jug</span> <span m="2709440">is</span> <span m="2709650">actually</span> <span m="2710220">empty.</span> <span m="2713920">So</span> <span m="2714120">let's</span> <span m="2714320">take</span> <span m="2714540">an</span> <span m="2714630">example.</span> </p>
<p></p>
<p><span m="2718436">So</span> <span m="2718850">let's</span> <span m="2719710">see.</span> <span m="2720890">Let's do that</span> <span m="2721670">over</span> <span m="2722300">here.</span> </p>
<p></p>
<p><span m="2726560">Actually</span> <span m="2726850">we</span> <span m="2726960">can</span> <span m="2727100">do</span> <span m="2727250">the</span> <span m="2727520">tennis</span> <span m="2727880">balls,</span> <span m="2728240">too.</span> <span m="2729960">Let's do</span> <span m="2730170">that</span> <span m="2730420">first.</span> <span m="2732100">See</span> <span m="2732330">how</span> <span m="2732490">that</span> <span m="2732670">works.</span> <span m="2734810">So</span> <span m="2736730">essentially,</span> <span m="2738260">in</span> <span m="2738450">order</span> <span m="2738590">to</span> <span m="2739780">get</span> <span m="2740240">4</span> <span m="2740570">gallons,</span> <span m="2741510">we</span> <span m="2741620">just</span> <span m="2741970">fill</span> <span m="2742210">up</span> <span m="2743610">the three</span> <span m="2744120">gallon</span> <span m="2744420">jug.</span> <span m="2745100">We</span> <span m="2745370">empty</span> <span m="2745870">it all</span> <span m="2746810">in</span> <span m="2746970">here.</span> </p>
<p></p>
<p><span m="2749780">We</span> <span m="2749900">fill</span> <span m="2750120">it</span> <span m="2750220">up</span> <span m="2750380">again.</span> <span m="2751670">You</span> <span m="2751680">pour</span> <span m="2751920">in</span> <span m="2752030">as</span> <span m="2752170">much</span> <span m="2752420">as</span> <span m="2752570">we</span> <span m="2752710">can.</span> <span m="2754110">That's--</span> <span m="2755140">that's</span> <span m="2755350">it.</span> <span m="2756480">We</span> <span m="2756580">have</span> <span m="2756790">to</span> <span m="2756950">empty</span> <span m="2757330">this</span> <span m="2757560">one.</span> <span m="2758660">Oops.</span> <span m="2761760">We</span> <span m="2761870">have</span> <span m="2762060">to</span> <span m="2762210">keep</span> <span m="2762500">on</span> <span m="2762630">pouring.</span> <span m="2764040">Put</span> <span m="2764210">this</span> <span m="2764430">in</span> <span m="2764540">here.</span> <span m="2765740">Fill</span> <span m="2767830">this</span> <span m="2768060">one up,</span> <span m="2770360">and</span> <span m="2770490">then</span> <span m="2770630">pour</span> <span m="2771100">over</span> <span m="2771320">into</span> <span m="2771430">the</span> <span m="2771510">five</span> <span m="2771780">gallon</span> <span m="2772060">jug.</span> <span m="2772900">And</span> <span m="2773000">now</span> <span m="2773140">we've</span> <span m="2773250">got</span> <span m="2774000">4</span> <span m="2774270">gallons</span> <span m="2774640">over</span> <span m="2774900">here.</span> <span m="2775640">So</span> <span m="2775850">what</span> <span m="2775990">did</span> <span m="2776130">we</span> <span m="2776230">do?</span> <span m="2777160">So</span> <span m="2777320">let's</span> <span m="2777510">write</span> <span m="2777700">it</span> <span m="2777830">out.</span> </p>
<p><span m="2779490">So</span> <span m="2780170">for</span> <span m="2780400">our</span> <span m="2780570">special</span> <span m="2781030">linear</span> <span m="2781330">combination</span> <span m="2782140">over</span> <span m="2782450">here,</span> <span m="2783180">we</span> <span m="2783300">have</span> <span m="2783650">that</span> <span m="2784140">4</span> <span m="2784580">equals</span> <span m="2785020">3,</span> <span m="2785260">times</span> <span m="2785600">3,</span> <span m="2786350">minus</span> <span m="2786800">1,</span> <span m="2787010">times</span> <span m="2787380">5.</span> <span m="2789040">So</span> <span m="2789720">we</span> <span m="2789910">need</span> <span m="2790270">to</span> <span m="2790840">repeat</span> <span m="2791350">this</span> <span m="2791580">process</span> <span m="2792300">three</span> <span m="2792640">times.</span> <span m="2793620">So</span> <span m="2793830">let's</span> <span m="2794040">do</span> <span m="2794180">that.</span> <span m="2795740">In</span> <span m="2795910">our</span> <span m="2796060">first</span> <span m="2798323">loop</span> <span m="2800780">we</span> <span m="2801120">will</span> <span m="2801220">do</span> <span m="2801340">the</span> <span m="2801440">following.</span> <span m="2802150">We</span> <span m="2802250">start</span> <span m="2802570">with</span> <span m="2802840">the</span> <span m="2804180">start</span> <span m="2804580">state,</span> <span m="2805300">the</span> <span m="2805410">pair</span> <span m="2805640">0, 0.</span> <span m="2807490">We're</span> <span m="2807620">going</span> <span m="2807850">to</span> <span m="2807950">fill</span> <span m="2808240">up</span> <span m="2808800">the</span> <span m="2809020">very</span> <span m="2809250">first</span> <span m="2809690">jug</span> <span m="2810010">all</span> <span m="2810330">the</span> <span m="2810400">way</span> <span m="2810600">up</span> <span m="2810720">to</span> <span m="2811050">its</span> <span m="2811310">capacity,</span> <span m="2811860">3.</span> <span m="2812950">And</span> <span m="2813090">we</span> <span m="2813240">put</span> <span m="2813510">it</span> <span m="2813590">all</span> <span m="2813840">over</span> <span m="2815230">into</span> <span m="2815390">the</span> <span m="2815650">b</span> <span m="2815930">jug.</span> </p>
<p><span m="2817860">What</span> <span m="2818090">happens</span> <span m="2818390">in</span> <span m="2818490">the</span> <span m="2818520">second</span> <span m="2818920">loop?</span> </p>
<p></p>
<p><span m="2824850">The</span> <span m="2824950">second</span> <span m="2825280">loop,</span> <span m="2826380">we</span> <span m="2826500">again</span> <span m="2827910">fill</span> <span m="2828100">up</span> <span m="2828250">the</span> <span m="2828420">a jug.</span> <span m="2829200">So</span> <span m="2830250">we have--</span> <span m="2830690">we</span> <span m="2830780">start</span> <span m="2831130">at</span> <span m="2831200">0,</span> <span m="2831790">3.</span> <span m="2833320">We</span> <span m="2833460">fill</span> <span m="2833690">it</span> <span m="2833790">up.</span> <span m="2835730">We</span> <span m="2835860">get</span> <span m="2836100">3, 3,</span> <span m="2836570">the pair</span> <span m="2837040">3, 3.</span> <span m="2838430">We pour</span> <span m="2838880">everything</span> <span m="2839440">in</span> <span m="2839630">here,</span> <span m="2840130">as</span> <span m="2840330">much</span> <span m="2840560">as</span> <span m="2840700">we</span> <span m="2840810">can.</span> <span m="2842330">That</span> <span m="2842550">give</span> <span m="2842770">us</span> <span m="2843010">1,</span> <span m="2843740">5.</span> <span m="2844320">Only</span> <span m="2844670">2</span> <span m="2845690">gallons</span> <span m="2846120">are</span> <span m="2846580">poured</span> <span m="2847040">into</span> <span m="2847180">the</span> <span m="2847280">bigger</span> <span m="2847470">gallon.</span> <span m="2849180">We</span> <span m="2849400">empty</span> <span m="2849710">the</span> <span m="2850200">bigger</span> <span m="2850600">gallon,</span> <span m="2850950">the</span> <span m="2851360">bigger</span> <span m="2851500">jug.</span> <span m="2852230">We</span> <span m="2852720">get</span> <span m="2853040">1, 0.</span> <span m="2854940">And</span> <span m="2855090">we</span> <span m="2855210">keep</span> <span m="2855460">on</span> <span m="2855610">pouring,</span> <span m="2856330">and</span> <span m="2856490">you</span> <span m="2856560">get</span> <span m="2856780">0, 1.</span> </p>
<p><span m="2859110">So</span> <span m="2859310">now</span> <span m="2859580">in</span> <span m="2859740">the</span> <span m="2859840">third</span> <span m="2860330">loop--</span> <span m="2861070">and</span> <span m="2861420">that's</span> <span m="2861660">where</span> <span m="2861920">we</span> <span m="2862010">should</span> <span m="2862290">get</span> <span m="2862840">the</span> <span m="2862940">4 gallons.</span> </p>
<p></p>
<p><span m="2867110">We</span> <span m="2867220">start</span> <span m="2867590">off</span> <span m="2867880">with</span> <span m="2868240">0,1.</span> <span m="2871440">Um,</span> <span m="2872150">we</span> <span m="2872230">fill</span> <span m="2872520">up</span> <span m="2874210">the a</span> <span m="2874550">jug.</span> <span m="2877150">We</span> <span m="2877360">pour</span> <span m="2877640">everything</span> <span m="2878230">over</span> <span m="2878710">into</span> <span m="2879050">the</span> <span m="2879160">bigger</span> <span m="2879980">jug,</span> <span m="2881000">and</span> <span m="2881170">we</span> <span m="2881300">get</span> <span m="2881900">0, 4.</span> <span m="2883910">And</span> <span m="2884040">that's</span> <span m="2884230">the</span> <span m="2884360">end result.</span> </p>
<p><span m="2886210">So</span> <span m="2886920">this</span> <span m="2887110">algorithm</span> <span m="2888240">seems</span> <span m="2888550">to</span> <span m="2888660">work</span> <span m="2888850">for</span> <span m="2888940">this</span> <span m="2889090">particular</span> <span m="2889520">example.</span> <span m="2889970">Of course</span> <span m="2890420">we</span> <span m="2890600">would</span> <span m="2890670">like</span> <span m="2890850">to</span> <span m="2890950">prove</span> <span m="2891350">it</span> <span m="2891620">for</span> <span m="2892030">the</span> <span m="2892070">general</span> <span m="2892390">situation.</span> <span m="2893520">So</span> <span m="2893570">how</span> <span m="2893700">do</span> <span m="2893790">we</span> <span m="2893890">do it?</span> </p>
<p></p>
<p><span m="2896800">Well,</span> <span m="2897060">we're</span> <span m="2897140">going</span> <span m="2897370">to</span> <span m="2897480">just</span> <span m="2897880">to</span> <span m="2898270">analyze</span> <span m="2898910">the</span> <span m="2902290">algorithm</span> <span m="2902780">in</span> <span m="2902840">the</span> <span m="2902920">following</span> <span m="2903380">way.</span> <span m="2907000">We</span> <span m="2907130">can</span> <span m="2907340">notice</span> <span m="2908100">that</span> <span m="2910180">in</span> <span m="2910360">this</span> <span m="2910590">algorithm,</span> <span m="2912530">we</span> <span m="2912620">fill</span> <span m="2912900">up</span> <span m="2913440">s</span> <span m="2913740">prime</span> <span m="2914050">times</span> <span m="2914620">the a</span> <span m="2914830">jug,</span> <span m="2916020">and</span> <span m="2916260">we</span> <span m="2917390">essentially</span> <span m="2917970">pour</span> <span m="2918320">everything</span> <span m="2918940">out</span> <span m="2920790">into</span> <span m="2921490">the</span> <span m="2921590">b jugs,</span> <span m="2922420">and</span> <span m="2922630">we</span> <span m="2922740">sometimes</span> <span m="2923730">empty the</span> <span m="2924170">b</span> <span m="2924380">jug.</span> <span m="2925660">So</span> <span m="2925870">let's</span> <span m="2926110">try</span> <span m="2926320">to</span> <span m="2926600">think</span> <span m="2926900">about</span> <span m="2927160">this</span> <span m="2927360">a</span> <span m="2927410">little</span> <span m="2927670">bit,</span> <span m="2928170">and</span> <span m="2928280">see</span> <span m="2928460">how</span> <span m="2928610">we</span> <span m="2928740">could</span> <span m="2928950">try</span> <span m="2929130">to</span> <span m="2929240">formalize</span> <span m="2929860">this.</span> </p>
<p><span m="2931030">So</span> <span m="2931250">let's</span> <span m="2931460">write</span> <span m="2931650">it</span> <span m="2931780">out.</span> <span m="2934700">We</span> <span m="2934850">have</span> <span m="2935100">filled</span> <span m="2935630">the</span> <span m="2936580">a</span> <span m="2937670">gallon</span> <span m="2937890">jug</span> <span m="2941770">s</span> <span m="2941950">prime</span> <span m="2942400">times.</span> <span m="2945360">We</span> <span m="2945530">also</span> <span m="2945930">know</span> <span m="2946830">that</span> <span m="2947050">the</span> <span m="2947510">b</span> <span m="2948130">jug</span> <span m="2948750">has</span> <span m="2948940">been</span> <span m="2949110">emptied</span> <span m="2949500">a</span> <span m="2949600">certain</span> <span m="2949880">number</span> <span m="2950130">of</span> <span m="2950260">times.</span> <span m="2950880">So</span> <span m="2951150">let's--</span> <span m="2954610">let's</span> <span m="2954800">just</span> <span m="2955000">assume--</span> <span m="2955510">suppose</span> <span m="2956030">that</span> <span m="2957782">the</span> <span m="2958250">b</span> <span m="2958670">jug</span> <span m="2962200">is</span> <span m="2962450">actually</span> <span m="2962820">emptied,</span> <span m="2963230">say,</span> <span m="2963760">u</span> <span m="2964100">times.</span> </p>
<p></p>
<p><span m="2970700">I</span> <span m="2970810">do</span> <span m="2970950">not</span> <span m="2971180">know</span> <span m="2971870">how</span> <span m="2972050">many</span> <span m="2972360">times.</span> <span m="2972800">But</span> <span m="2973040">I</span> <span m="2973150">say,</span> <span m="2973430">well,</span> <span m="2973590">let's</span> <span m="2973810">assume</span> <span m="2974190">it's</span> <span m="2974330">u</span> <span m="2974520">times,</span> <span m="2974900">and</span> <span m="2975450">try</span> <span m="2975650">to</span> <span m="2975990">figure</span> <span m="2976300">out</span> <span m="2976470">whether</span> <span m="2976650">we</span> <span m="2976810">can</span> <span m="2977340">find</span> <span m="2977610">some</span> <span m="2977770">algebraic</span> <span m="2978290">expression.</span> <span m="2980470">So</span> <span m="2982510">at</span> <span m="2982670">the</span> <span m="2982790">very</span> <span m="2983040">end</span> <span m="2983500">of the</span> <span m="2983640">algorithm,</span> <span m="2984690">let</span> <span m="2984850">r</span> <span m="2985150">be</span> <span m="2985370">what</span> <span m="2986520">is</span> <span m="2986960">in</span> <span m="2987400">the</span> <span m="2987500">b jug.</span> <span m="2988270">So</span> <span m="2988520">let</span> <span m="2988730">r</span> <span m="2989040">be</span> <span m="2991515">the</span> <span m="2992010">remainder,</span> <span m="2997160">in</span> <span m="2997350">the</span> <span m="2997430">b</span> <span m="2997600">gallon</span> <span m="2997880">jug.</span> </p>
<p></p>
<p><span m="3003500">So</span> <span m="3003800">now</span> <span m="3004000">we</span> <span m="3004120">can</span> <span m="3004290">continue.</span> <span m="3006220">We</span> <span m="3006370">know</span> <span m="3006720">if</span> <span m="3007010">r</span> <span m="3007250">is</span> <span m="3007720">what</span> <span m="3007970">left</span> <span m="3008510">in the</span> <span m="3008580">b</span> <span m="3008770">gallon</span> <span m="3009060">jug,</span> <span m="3009780">well,</span> <span m="3009940">we</span> <span m="3010050">know</span> <span m="3010320">already</span> <span m="3011160">some</span> <span m="3011360">property</span> <span m="3011930">of</span> <span m="3012090">it.</span> <span m="3013780">Actually,</span> <span m="3014170">let's</span> <span m="3014280">put</span> <span m="3014430">that on</span> <span m="3014910">the next</span> <span m="3015336">board.</span> <span m="3017040">We</span> <span m="3017180">know</span> <span m="3017400">that</span> <span m="3019690">0</span> <span m="3020220">is</span> <span m="3020440">at</span> <span m="3020550">most</span> <span m="3020890">r,</span> <span m="3021620">and</span> <span m="3021730">at</span> <span m="3021880">most</span> <span m="3022230">b,</span> <span m="3022580">because</span> <span m="3022930">that's</span> <span m="3023140">what's</span> <span m="3023410">left</span> <span m="3023740">in</span> <span m="3023830">the b</span> <span m="3024130">gallon</span> <span m="3024390">jug,</span> <span m="3024680">right?</span> <span m="3025170">So</span> <span m="3025430">we</span> <span m="3025550">know</span> <span m="3025730">these</span> <span m="3025920">bounds.</span> <span m="3027740">We</span> <span m="3027890">have</span> <span m="3028080">assumed</span> <span m="3028910">that</span> <span m="3029220">0</span> <span m="3029770">is</span> <span m="3030010">less than L,</span> <span m="3030990">is</span> <span m="3031220">less</span> <span m="3031470">than</span> <span m="3031620">b,</span> <span m="3033700">which</span> <span m="3034340">we</span> <span m="3034530">put</span> <span m="3034630">over</span> <span m="3034790">there.</span> <span m="3036620">We</span> <span m="3037810">know</span> <span m="3038340">that</span> <span m="3038620">r</span> <span m="3039260">must</span> <span m="3039610">be</span> <span m="3039790">equal</span> <span m="3040170">to</span> <span m="3040400">what</span> <span m="3040650">kind</span> <span m="3040860">of</span> <span m="3040950">linear</span> <span m="3041220">combination</span> <span m="3041890">of</span> <span m="3042100">s</span> <span m="3042340">prime,</span> <span m="3043420">and</span> <span m="3045780">u?</span> </p>
<p><span m="3046720">So--</span> <span m="3047560">Well,</span> <span m="3047750">we</span> <span m="3047870">have</span> <span m="3048970">been</span> <span m="3049150">filling</span> <span m="3049500">of</span> <span m="3050240">s</span> <span m="3050510">prime</span> <span m="3050840">times.</span> <span m="3052240">So</span> <span m="3053430">this</span> <span m="3053640">is</span> <span m="3053790">what</span> <span m="3053990">we</span> <span m="3054190">added</span> <span m="3054640">in</span> <span m="3054800">water</span> <span m="3055240">to</span> <span m="3055370">the</span> <span m="3055470">whole</span> <span m="3056590">system,</span> <span m="3057020">you</span> <span m="3057160">can</span> <span m="3057330">say,</span> <span m="3057680">s</span> <span m="3057950">prime</span> <span m="3058280">times</span> <span m="3058740">a.</span> <span m="3059660">And</span> <span m="3059860">we</span> <span m="3059980">poured</span> <span m="3060290">out</span> <span m="3061110">water.</span> <span m="3062060">Well,</span> <span m="3063280">we did</span> <span m="3063670">that u</span> <span m="3063930">times</span> <span m="3065100">from</span> <span m="3065370">the</span> <span m="3065500">b</span> <span m="3065740">gallon</span> <span m="3066350">jug.</span> <span m="3066890">So</span> <span m="3067180">we</span> <span m="3067310">poured</span> <span m="3067570">out</span> <span m="3067910">u</span> <span m="3068110">times</span> <span m="3068560">b</span> <span m="3068780">gallons.</span> <span m="3069830">So</span> <span m="3069980">this</span> <span m="3070210">is</span> <span m="3070370">the</span> <span m="3070460">remainder</span> <span m="3071180">that</span> <span m="3071320">this</span> <span m="3071510">left</span> <span m="3072400">in</span> <span m="3072570">this</span> <span m="3072770">bigger</span> <span m="3073020">jug,</span> <span m="3073520">right?</span> <span m="3074910">So</span> <span m="3075430">are</span> <span m="3075610">there any</span> <span m="3075790">questions</span> <span m="3076190">about</span> <span m="3076490">this?</span> <span m="3077940">So--</span> <span m="3081190">OK.</span> </p>
<p><span m="3082150">So</span> <span m="3082960">we</span> <span m="3083120">also</span> <span m="3083370">know</span> <span m="3083590">that</span> <span m="3083820">L</span> <span m="3084550">is</span> <span m="3084780">equal</span> <span m="3085200">to</span> <span m="3086690">s</span> <span m="3087010">prime,</span> <span m="3087470">times</span> <span m="3087940">a,</span> <span m="3088460">plus</span> <span m="3088930">t</span> <span m="3089430">prime,</span> <span m="3089850">times</span> <span m="3090300">b.</span> <span m="3091220">And</span> <span m="3091380">this</span> <span m="3091600">is</span> <span m="3092580">the</span> <span m="3092630">linear</span> <span m="3092910">combination</span> <span m="3093500">that</span> <span m="3093570">we</span> <span m="3093890">would</span> <span m="3094070">try</span> <span m="3094370">to</span> <span m="3095280">prove</span> <span m="3095960">of,</span> <span m="3096550">that it</span> <span m="3096820">is</span> <span m="3098010">left</span> <span m="3098420">at</span> <span m="3098570">the</span> <span m="3098710">very</span> <span m="3099010">end.</span> <span m="3099240">So</span> <span m="3099380">what</span> <span m="3099520">we</span> <span m="3099640">want</span> <span m="3099830">to</span> <span m="3099920">show is</span> <span m="3100360">that r</span> <span m="3100560">equals</span> <span m="3101280">L.</span> </p>
<p><span m="3102440">So</span> <span m="3102610">how</span> <span m="3102730">do</span> <span m="3102820">we</span> <span m="3102930">do</span> <span m="3103100">that</span> <span m="3103320">now?</span> <span m="3104290">How are</span> <span m="3104340">we</span> <span m="3104470">going</span> <span m="3104690">to</span> <span m="3104820">show</span> <span m="3108950">that</span> <span m="3109120">r</span> <span m="3110260">can</span> <span m="3110410">be</span> <span m="3110500">expressed</span> <span m="3111110">in</span> <span m="3111595">L,</span> <span m="3112080">in a</span> <span m="3112110">special</span> <span m="3112580">way.</span> <span m="3112770">So</span> <span m="3112940">let's</span> <span m="3113120">have</span> <span m="3113300">a</span> <span m="3113360">look.</span> <span m="3113710">So</span> <span m="3113810">these</span> <span m="3114050">are</span> <span m="3114150">all</span> <span m="3114960">tricks</span> <span m="3117460">in</span> <span m="3117600">the</span> <span m="3117700">sense</span> <span m="3118150">that</span> <span m="3119150">I'm</span> <span m="3119310">giving</span> <span m="3119610">you</span> <span m="3119730">this proof,</span> <span m="3120450">but</span> <span m="3120700">how</span> <span m="3120930">do</span> <span m="3121000">you</span> <span m="3121120">come</span> <span m="3121300">up</span> <span m="3121430">with</span> <span m="3121540">this</span> <span m="3121700">yourself?</span> <span m="3123340">Sometimes</span> <span m="3124000">you</span> <span m="3124150">play</span> <span m="3124480">a</span> <span m="3124560">lot</span> <span m="3124870">with</span> <span m="3125090">these</span> <span m="3125280">kinds</span> <span m="3125520">of</span> <span m="3125650">things,</span> <span m="3125990">and</span> <span m="3126090">you</span> <span m="3127320">get</span> <span m="3127480">a</span> <span m="3127580">feeling</span> <span m="3128110">of</span> <span m="3128620">what</span> <span m="3128910">kind</span> <span m="3129160">of--</span> <span m="3131070">sort</span> <span m="3131250">of</span> <span m="3131450">pattern</span> <span m="3132250">exists,</span> <span m="3133140">and</span> <span m="3133710">what</span> <span m="3133920">kind</span> <span m="3134160">of</span> <span m="3135280">intuition</span> <span m="3136080">you need</span> <span m="3136560">in</span> <span m="3136680">order</span> <span m="3136860">to</span> <span m="3137030">write</span> <span m="3137220">down</span> <span m="3137560">a proof</span> <span m="3137790">like</span> <span m="3137980">this.</span> </p>
<p><span m="3139070">So</span> <span m="3139290">let's</span> <span m="3141040">rewrite</span> <span m="3141460">this.</span> <span m="3142910">I'm</span> <span m="3143050">going</span> <span m="3143290">add</span> <span m="3144010">t</span> <span m="3144250">prime</span> <span m="3144960">times</span> <span m="3145350">b.</span> <span m="3146030">And</span> <span m="3146200">I'm</span> <span m="3146280">going to</span> <span m="3146460">subtract</span> <span m="3146790">it</span> <span m="3147120">again.</span> <span m="3150530">So</span> <span m="3150820">I</span> <span m="3150920">have</span> <span m="3151360">s</span> <span m="3151560">prime</span> <span m="3151810">times</span> <span m="3152170">a,</span> <span m="3153200">plus</span> <span m="3153480">t</span> <span m="3153640">prime</span> <span m="3153910">times</span> <span m="3154290">b.</span> <span m="3154650">I</span> <span m="3155010">subtract</span> <span m="3155520">it</span> <span m="3155630">again,</span> <span m="3156270">and</span> <span m="3156410">I</span> <span m="3156440">still</span> <span m="3156770">have</span> <span m="3157040">this</span> <span m="3157260">amount</span> <span m="3157600">left</span> <span m="3157930">open</span> <span m="3158240">here.</span> </p>
<p><span m="3159820">So</span> <span m="3160000">what</span> <span m="3160140">is</span> <span m="3160290">this</span> <span m="3160450">equal</span> <span m="3160860">to?</span> <span m="3161755">Well</span> <span m="3162170">this</span> <span m="3163190">part</span> <span m="3163580">is</span> <span m="3163730">equal</span> <span m="3164050">to</span> <span m="3164270">L.</span> <span m="3166060">So this</span> <span m="3166270">is</span> <span m="3166380">equal</span> <span m="3166630">to</span> <span m="3166840">minus--</span> <span m="3168840">and</span> <span m="3168980">I</span> <span m="3169020">have</span> <span m="3169150">a</span> <span m="3169290">multiple</span> <span m="3169780">of</span> <span m="3169910">b,</span> <span m="3170680">which</span> <span m="3170920">is</span> <span m="3171670">t prime,</span> <span m="3172140">plus</span> <span m="3172550">u</span> <span m="3172760">times</span> <span m="3173220">b.</span> </p>
<p></p>
<p><span m="3176636">Hm.</span> <span m="3179210">Now this</span> <span m="3179380">is</span> <span m="3179540">very</span> <span m="3179770">interesting.</span> <span m="3180280">Does</span> <span m="3180460">anybody</span> <span m="3180840">see</span> <span m="3181140">how</span> <span m="3181310">we</span> <span m="3181430">could</span> <span m="3181590">continue here?</span> <span m="3182760">So</span> <span m="3182980">we</span> <span m="3183100">have</span> <span m="3183870">r</span> <span m="3184520">expressed</span> <span m="3185180">as</span> <span m="3185520">L,</span> <span m="3186460">minus a</span> <span m="3186600">multiple</span> <span m="3187080">of</span> <span m="3187190">b.</span> <span m="3188260">And</span> <span m="3188450">I</span> <span m="3188550">also</span> <span m="3188810">know</span> <span m="3189050">that</span> <span m="3189260">L</span> <span m="3189520">is</span> <span m="3189700">in</span> <span m="3189810">this</span> <span m="3190030">range.</span> <span m="3190630">I</span> <span m="3191090">also</span> <span m="3191350">know that</span> <span m="3191670">r is</span> <span m="3192030">in</span> <span m="3192140">this</span> <span m="3192390">range.</span> <span m="3193540">So</span> <span m="3193570">that's</span> <span m="3193790">kind</span> <span m="3193980">of</span> <span m="3194070">interesting,</span> <span m="3194770">right?</span> <span m="3195030">So</span> <span m="3195600">how</span> <span m="3195790">can</span> <span m="3196000">that</span> <span m="3196150">be?</span> <span m="3198730">What</span> <span m="3199330">should</span> <span m="3199510">be</span> <span m="3199640">the</span> <span m="3199780">case</span> <span m="3200130">here?</span> <span m="3200560">Does</span> <span m="3200870">anybody</span> <span m="3201260">see</span> <span m="3201570">what</span> <span m="3202720">kind</span> <span m="3202930">of</span> <span m="3203030">property</span> <span m="3204000">t</span> <span m="3204180">prime</span> <span m="3204570">plus u</span> <span m="3205660">must</span> <span m="3205940">have</span> <span m="3206630">in order</span> <span m="3207410">to</span> <span m="3207760">make</span> <span m="3207950">that</span> <span m="3208240">happen?</span> <span m="3210490">So let's have</span> <span m="3210980">a look</span> <span m="3211470">here.</span> <span m="3211960">We have L.</span> <span m="3213930">It's</span> <span m="3214400">in this range.</span> <span m="3215300">So</span> <span m="3215490">let's</span> <span m="3215740">just</span> <span m="3215980">draw</span> <span m="3216300">an axis.</span> <span m="3217720">So at</span> <span m="3217950">0,</span> <span m="3218840">we</span> <span m="3218990">have</span> <span m="3219310">b.</span> <span m="3220340">And</span> <span m="3220500">somehow</span> <span m="3221290">in</span> <span m="3221460">this</span> <span m="3221750">range,</span> <span m="3224570">we</span> <span m="3224770">have</span> <span m="3225950">L.</span> <span m="3228100">Now</span> <span m="3228300">if</span> <span m="3228540">I</span> <span m="3228650">subtract</span> <span m="3229820">like</span> <span m="3231150">actually</span> <span m="3231445">b,</span> <span m="3231740">or</span> <span m="3232030">something</span> <span m="3232310">more</span> <span m="3232510">than</span> <span m="3232680">b,</span> <span m="3233590">or I</span> <span m="3233870">add</span> <span m="3234160">more</span> <span m="3234330">than</span> <span m="3234500">b.</span> <span m="3235470">I will</span> <span m="3235730">jump</span> <span m="3235990">out</span> <span m="3236270">of</span> <span m="3236390">this</span> <span m="3236610">range,</span> <span m="3237190">and I</span> <span m="3237500">go</span> <span m="3237660">somewhere</span> <span m="3238020">over</span> <span m="3238320">here,</span> <span m="3239010">or I</span> <span m="3239230">go</span> <span m="3239350">somewhere</span> <span m="3239740">over</span> <span m="3239950">there.</span> <span m="3241510">Right?</span> <span m="3242160">So</span> <span m="3243170">if</span> <span m="3243390">I</span> <span m="3243460">said</span> <span m="3243850">suppose</span> <span m="3244430">L</span> <span m="3244640">is</span> <span m="3244800">over</span> <span m="3245110">here,</span> <span m="3246050">then</span> <span m="3246640">L</span> <span m="3246950">minus</span> <span m="3247410">b</span> <span m="3247580">would</span> <span m="3247720">be</span> <span m="3247850">over</span> <span m="3248120">here,</span> <span m="3248480">which</span> <span m="3248580">would</span> <span m="3248640">be</span> <span m="3248760">negative.</span> <span m="3249960">Or</span> <span m="3250570">if</span> <span m="3250770">I</span> <span m="3250860">add</span> <span m="3251280">b,</span> <span m="3251680">it will</span> <span m="3251920">be</span> <span m="3252040">over</span> <span m="3252280">here,</span> <span m="3252900">which</span> <span m="3253090">would</span> <span m="3253230">be</span> <span m="3253380">more</span> <span m="3253610">than</span> <span m="3253790">b.</span> </p>
<p><span m="3255670">Now</span> <span m="3256090">we</span> <span m="3256320">know</span> <span m="3256550">that this</span> <span m="3256800">is</span> <span m="3256880">equal</span> <span m="3257180">to</span> <span m="3257340">r,</span> <span m="3257680">but</span> <span m="3257870">r</span> <span m="3258310">is</span> <span m="3258490">in</span> <span m="3258600">this</span> <span m="3258850">range.</span> <span m="3260120">So</span> <span m="3260270">that's</span> <span m="3260620">not</span> <span m="3260830">really</span> <span m="3261070">possible.</span> <span m="3261810">So</span> <span m="3261990">let's</span> <span m="3262180">write</span> <span m="3262370">it</span> <span m="3262490">out.</span> <span m="3263780">So</span> <span m="3264890">if</span> <span m="3265690">t</span> <span m="3265930">prime</span> <span m="3266230">plus</span> <span m="3266530">u</span> <span m="3267510">is</span> <span m="3268010">unequal</span> <span m="3268360">to</span> <span m="3268490">0,</span> <span m="3269370">so</span> <span m="3269590">we're</span> <span m="3269760">actually</span> <span m="3270190">really</span> <span m="3270740">subtract</span> <span m="3271420">or</span> <span m="3271610">add</span> <span m="3272500">a</span> <span m="3272600">multiple</span> <span m="3273280">of</span> <span m="3273430">b.</span> <span m="3276300">Then</span> <span m="3276480">I</span> <span m="3276560">know</span> <span m="3277530">that</span> <span m="3278750">r</span> <span m="3279280">is</span> <span m="3279570">either</span> <span m="3279880">smaller</span> <span m="3280340">than</span> <span m="3280540">0,</span> <span m="3281770">or</span> <span m="3282040">r</span> <span m="3282310">is</span> <span m="3282840">larger</span> <span m="3283220">than</span> <span m="3283390">b.</span> <span m="3285110">Now</span> <span m="3285260">we</span> <span m="3285380">know</span> <span m="3285670">that</span> <span m="3285840">cannot</span> <span m="3286170">be</span> <span m="3286280">the</span> <span m="3286430">case,</span> <span m="3286910">so</span> <span m="3287120">we</span> <span m="3287240">can</span> <span m="3287400">conclude</span> <span m="3288470">that</span> <span m="3289100">t prime</span> <span m="3289280">plus</span> <span m="3289950">u</span> <span m="3290330">equals</span> <span m="3290730">0.</span> <span m="3291600">Now</span> <span m="3291830">that</span> <span m="3292030">implies</span> <span m="3293800">that</span> <span m="3294970">t</span> <span m="3295160">prime</span> <span m="3295720">equals</span> <span m="3296480">minus</span> <span m="3296930">u,</span> <span m="3298520">or</span> <span m="3298750">maybe</span> <span m="3299060">other</span> <span m="3299200">way</span> <span m="3299340">around,</span> <span m="3300090">because</span> <span m="3300440">that's</span> <span m="3300650">easier</span> <span m="3301040">to</span> <span m="3301170">see</span> <span m="3301410">what's</span> <span m="3301600">happening.</span> </p>
<p><span m="3302200">So</span> <span m="3302980">u</span> <span m="3303500">equals</span> <span m="3304120">minus</span> <span m="3304560">t</span> <span m="3304810">prime.</span> <span m="3306300">If</span> <span m="3306460">you</span> <span m="3306580">plug</span> <span m="3306840">that</span> <span m="3307010">in</span> <span m="3307380">here,</span> <span m="3309290">well,</span> <span m="3309590">we</span> <span m="3309720">get</span> <span m="3309880">exactly</span> <span m="3310420">the</span> <span m="3310490">same</span> <span m="3310770">expression.</span> <span m="3311510">You</span> <span m="3311770">see?</span> <span m="3312590">Minus,</span> <span m="3313680">minus</span> <span m="3314190">t</span> <span m="3314370">prime</span> <span m="3315040">is</span> <span m="3315200">equal</span> <span m="3315380">to</span> <span m="3315500">plus</span> <span m="3315830">t</span> <span m="3315990">prime.</span> <span m="3316640">And</span> <span m="3316790">we</span> <span m="3316880">get</span> <span m="3317070">the</span> <span m="3317670">exact same linear</span> <span m="3317980">combination.</span> <span m="3318560">So</span> <span m="3318770">we</span> <span m="3318880">conclude</span> <span m="3319730">that</span> <span m="3319960">r</span> <span m="3320350">equals</span> <span m="3320770">L.</span> </p>
<p><span m="3321910">And</span> <span m="3322050">now</span> <span m="3322200">we're</span> <span m="3322360">done.</span> <span m="3323370">Why is</span> <span m="3323700">that?</span> <span m="3324420">Well,</span> <span m="3325310">we</span> <span m="3325430">have</span> <span m="3325590">shown</span> <span m="3326360">that</span> <span m="3326840">the</span> <span m="3327030">very</span> <span m="3327470">last</span> <span m="3328120">number</span> <span m="3328470">of</span> <span m="3328590">gallons</span> <span m="3329120">that is</span> <span m="3329290">left</span> <span m="3329610">after</span> <span m="3329960">this</span> <span m="3330190">procedure,</span> <span m="3330450">after</span> <span m="3330710">this</span> <span m="3331170">algorithm,</span> <span m="3332150">is</span> <span m="3332320">actually</span> <span m="3332670">exactly</span> <span m="3333310">equal</span> <span m="3333600">to</span> <span m="3334070">the</span> <span m="3334160">linear</span> <span m="3334440">combination</span> <span m="3335090">that</span> <span m="3335210">we</span> <span m="3335330">wanted</span> <span m="3335560">to</span> <span m="3335670">achieve.</span> <span m="3336630">So</span> <span m="3336680">now</span> <span m="3336850">we</span> <span m="3336960">got</span> <span m="3337160">the</span> <span m="3337240">proof</span> <span m="3338110">for this</span> <span m="3338450">theorem</span> <span m="3339550">that</span> <span m="3340050">tells</span> <span m="3340430">us</span> <span m="3340720">that</span> <span m="3343790">any</span> <span m="3344070">linear</span> <span m="3345110">combination</span> <span m="3346400">is</span> <span m="3346640">actually--</span> <span m="3349260">of</span> <span m="3349330">a</span> <span m="3349700">and</span> <span m="3349850">b</span> <span m="3350370">can</span> <span m="3350530">actually</span> <span m="3350860">be</span> <span m="3351040">reached</span> <span m="3351920">by</span> <span m="3352100">pouring</span> <span m="3353070">gallons</span> <span m="3353510">over</span> <span m="3353830">and</span> <span m="3353950">back,</span> <span m="3354250">and</span> <span m="3354450">emptying</span> <span m="3354930">and filling</span> <span m="3355250">those</span> <span m="3355460">jugs.</span> </p>
<p><span m="3356980">All</span> <span m="3357050">right</span> <span m="3357240">let's</span> <span m="3357780">continue.</span> <span m="3359170">So there</span> <span m="3359460">was a</span> <span m="3359740">question</span> <span m="3360120">over</span> <span m="3360300">here that</span> <span m="3360780">I</span> <span m="3360810">would</span> <span m="3360980">like</span> <span m="3361230">to--</span> <span m="3362020">that</span> <span m="3362150">I</span> <span m="3362170">would</span> <span m="3362290">like</span> <span m="3362490">to</span> <span m="3362590">address.</span> </p>
<p></p>
<p><span m="3365990">So</span> <span m="3366040">maybe</span> <span m="3366230">I did</span> <span m="3366330">not</span> <span m="3366620">make</span> <span m="3366860">so</span> <span m="3367010">clear</span> <span m="3368730">what</span> <span m="3369720">the s</span> <span m="3369850">prime,</span> <span m="3370600">and</span> <span m="3370830">the t</span> <span m="3371030">prime</span> <span m="3371380">is</span> <span m="3371500">over</span> <span m="3371720">here.</span> <span m="3372900">And</span> <span m="3374200">in</span> <span m="3374370">this</span> <span m="3374610">proof,</span> <span m="3375390">we</span> <span m="3375500">started</span> <span m="3375900">off</span> <span m="3376230">with</span> <span m="3376360">this</span> <span m="3376550">linear</span> <span m="3376790">combination.</span> <span m="3377430">I</span> <span m="3377480">would</span> <span m="3377710">like</span> <span m="3378120">to</span> <span m="3378520">have</span> <span m="3378930">an</span> <span m="3379060">algorithm</span> <span m="3380270">of</span> <span m="3380500">pouring</span> <span m="3381150">that</span> <span m="3381350">creates</span> <span m="3382040">L</span> <span m="3382680">gallons</span> <span m="3383420">in</span> <span m="3383630">say</span> <span m="3383850">the</span> <span m="3383940">bigger</span> <span m="3384180">jug.</span> <span m="3385990">So</span> <span m="3386830">in</span> <span m="3387030">order</span> <span m="3387220">to</span> <span m="3387350">do</span> <span m="3387630">that,</span> <span m="3388770">I</span> <span m="3388930">want</span> <span m="3389230">to</span> <span m="3389460">find,</span> <span m="3390120">say,</span> <span m="3390870">a</span> <span m="3391130">linear</span> <span m="3391390">combination</span> <span m="3393050">that</span> <span m="3393300">makes</span> <span m="3393630">this</span> <span m="3393870">L</span> <span m="3394340">such</span> <span m="3394610">that</span> <span m="3394790">this</span> <span m="3395040">s</span> <span m="3395290">prime</span> <span m="3395830">is</span> <span m="3396050">an</span> <span m="3396140">integer--</span> <span m="3397110">positive</span> <span m="3397530">integer.</span> </p>
<p><span m="3398160">Why</span> <span m="3398290">do</span> <span m="3398480">I</span> <span m="3398570">want</span> <span m="3398790">to</span> <span m="3399080">have a</span> <span m="3399360">positive</span> <span m="3399510">integer?</span> <span m="3400900">Because</span> <span m="3401940">in</span> <span m="3402120">this</span> <span m="3402410">algorithm,</span> <span m="3403130">I'm</span> <span m="3403320">going</span> <span m="3403490">to</span> <span m="3403650">repeat</span> <span m="3404030">something</span> <span m="3404420">s</span> <span m="3404630">prime</span> <span m="3404890">times.</span> <span m="3405190">If s</span> <span m="3405610">prime</span> <span m="3405820">is</span> <span m="3405950">negative,</span> <span m="3406460">I</span> <span m="3406540">cannot</span> <span m="3406850">do</span> <span m="3407000">it,</span> <span m="3407080">right?</span> <span m="3407670">So</span> <span m="3407850">s prime</span> <span m="3408170">has to</span> <span m="3408490">be a</span> <span m="3408620">positive</span> <span m="3408980">integer.</span> <span m="3410710">In</span> <span m="3410920">order</span> <span m="3411170">to</span> <span m="3411930">create</span> <span m="3413840">such</span> <span m="3414170">a</span> <span m="3414250">positive</span> <span m="3414660">integer,</span> <span m="3415200">I</span> <span m="3415320">can</span> <span m="3415500">just</span> <span m="3415850">add</span> <span m="3417260">like</span> <span m="3417550">1,000</span> <span m="3418180">times</span> <span m="3418790">b</span> <span m="3419020">times,</span> <span m="3419450">and</span> <span m="3420370">subtract</span> <span m="3420880">1,000</span> <span m="3421410">times</span> <span m="3422250">a</span> <span m="3422400">times</span> <span m="3422760">b.</span> <span m="3423160">That's</span> <span m="3423390">OK</span> <span m="3423840">I</span> <span m="3423930">could</span> <span m="3424150">just</span> <span m="3424470">add</span> <span m="3424720">a</span> <span m="3424830">lot.</span> <span m="3426080">And</span> <span m="3426270">if</span> <span m="3426410">I</span> <span m="3426490">add</span> <span m="3426760">enough,</span> <span m="3427890">I</span> <span m="3428070">can</span> <span m="3428460">make</span> <span m="3428860">s</span> <span m="3429140">plus</span> <span m="3429390">n</span> <span m="3429670">times</span> <span m="3429970">b</span> <span m="3430200">positive.</span> <span m="3431220">Even</span> <span m="3431510">if</span> <span m="3431770">s</span> <span m="3431870">is,</span> <span m="3432010">say,</span> <span m="3433160">minus</span> <span m="3433550">100,</span> <span m="3434170">well,</span> <span m="3434510">if</span> <span m="3434720">I</span> <span m="3435050">add</span> <span m="3435800">1,000</span> <span m="3436580">times</span> <span m="3437020">5,</span> <span m="3437620">I</span> <span m="3437770">will</span> <span m="3437940">get</span> <span m="3438100">a</span> <span m="3438170">positive</span> <span m="3438640">number.</span> </p>
<p><span m="3439770">So</span> <span m="3439840">that's</span> <span m="3440490">sort</span> <span m="3440740">of</span> <span m="3440850">the</span> <span m="3440950">reason</span> <span m="3441450">this</span> <span m="3441620">proof</span> <span m="3442520">that</span> <span m="3442690">we</span> <span m="3443230">want</span> <span m="3443520">to</span> <span m="3443740">rewrite</span> <span m="3444230">the</span> <span m="3444310">linear</span> <span m="3444680">combination</span> <span m="3445310">to</span> <span m="3445450">a</span> <span m="3445510">new</span> <span m="3445810">one,</span> <span m="3446370">such</span> <span m="3446830">that</span> <span m="3447130">s</span> <span m="3447370">prime</span> <span m="3447630">is</span> <span m="3447780">positive.</span> <span m="3449040">And</span> <span m="3449270">if</span> <span m="3449410">we</span> <span m="3449510">have</span> <span m="3449700">s</span> <span m="3449950">prime</span> <span m="3450180">positive,</span> <span m="3451430">then</span> <span m="3451630">we</span> <span m="3451800">can</span> <span m="3452020">actually</span> <span m="3452460">talk</span> <span m="3452720">about</span> <span m="3452970">this</span> <span m="3453140">algorithm,</span> <span m="3454070">because</span> <span m="3454460">we</span> <span m="3454580">can</span> <span m="3454770">only</span> <span m="3455460">repeat</span> <span m="3455880">something</span> <span m="3457040">s</span> <span m="3457240">prime</span> <span m="3457520">times,</span> <span m="3457890">if s</span> <span m="3458280">prime</span> <span m="3458640">is</span> <span m="3459130">say</span> <span m="3459420">1,</span> <span m="3459730">or</span> <span m="3459830">2,</span> <span m="3460040">or</span> <span m="3460150">3,</span> <span m="3460480">or</span> <span m="3460810">something</span> <span m="3461170">positive.</span> </p>
<p></p>
<p><span m="3464970">All</span> <span m="3465120">right.</span> <span m="3466330">So</span> <span m="3467640">let's--</span> <span m="3468960">I'll</span> <span m="3469240">talk</span> <span m="3469500">about</span> <span m="3469940">say</span> <span m="3470090">the</span> <span m="3470220">next</span> <span m="3470560">part.</span> <span m="3471470">So</span> <span m="3471750">we</span> <span m="3471880">have</span> <span m="3472110">gone--</span> <span m="3473560">We have</span> <span m="3473830">proved</span> <span m="3475100">two</span> <span m="3475310">theorems.</span> <span m="3476480">But</span> <span m="3476600">in the</span> <span m="3476840">end we</span> <span m="3477130">would</span> <span m="3477330">like</span> <span m="3477620">to</span> <span m="3477800">have</span> <span m="3478370">a</span> <span m="3480670">characterization</span> <span m="3481540">of</span> <span m="3481650">the</span> <span m="3481730">greatest</span> <span m="3482140">common</span> <span m="3482360">divisor.</span> <span m="3482820">That's</span> <span m="3483020">the</span> <span m="3483140">goal</span> <span m="3483720">of</span> <span m="3483920">this</span> <span m="3484080">lecture.</span> </p>
<p><span m="3485410">So</span> <span m="3485500">let's</span> <span m="3485730">do</span> <span m="3485890">it.</span> <span m="3487250">Um.</span> <span m="3490000">In</span> <span m="3490170">order</span> <span m="3490360">to</span> <span m="3490510">do</span> <span m="3490690">this,</span> <span m="3492370">let's</span> <span m="3493410">first</span> <span m="3493730">of</span> <span m="3493810">all</span> <span m="3494750">look</span> <span m="3495000">at</span> <span m="3495120">our</span> <span m="3495350">five</span> <span m="3495790">gallon,</span> <span m="3496200">and</span> <span m="3496410">three</span> <span m="3496640">gallon</span> <span m="3497000">example.</span> <span m="3498290">We</span> <span m="3498320">know</span> <span m="3498480">that</span> <span m="3498660">the</span> <span m="3498750">greatest</span> <span m="3499180">common</span> <span m="3499420">divisor</span> <span m="3500050">is</span> <span m="3500280">equal</span> <span m="3500520">to</span> <span m="3500690">1.</span> <span m="3502830">We</span> <span m="3502960">know</span> <span m="3503220">that</span> <span m="3504820">1</span> <span m="3505250">can</span> <span m="3505450">be</span> <span m="3505650">rewritten</span> <span m="3508610">as</span> <span m="3509100">a</span> <span m="3509170">linear</span> <span m="3509550">combination,</span> <span m="3510230">as</span> <span m="3510430">2</span> <span m="3510740">times</span> <span m="3511150">3,</span> <span m="3512280">minus</span> <span m="3513540">1</span> <span m="3513880">times</span> <span m="3514410">5.</span> <span m="3515960">So</span> <span m="3516160">that</span> <span m="3516320">means</span> <span m="3516640">that</span> <span m="3517060">according</span> <span m="3517540">to</span> <span m="3517670">the</span> <span m="3517790">theorem</span> <span m="3518220">that</span> <span m="3518410">we</span> <span m="3518530">have</span> <span m="3518800">up</span> <span m="3518950">here,</span> <span m="3520010">we</span> <span m="3520160">can</span> <span m="3520430">actually</span> <span m="3522610">make</span> <span m="3523140">exactly</span> <span m="3523870">1</span> <span m="3524120">gallon</span> <span m="3525630">in</span> <span m="3526290">one</span> <span m="3526500">of</span> <span m="3526610">these</span> <span m="3526820">jugs.</span> <span m="3528140">So</span> <span m="3528320">that</span> <span m="3528540">means</span> <span m="3528910">that</span> <span m="3529070">we</span> <span m="3529190">can</span> <span m="3529340">also</span> <span m="3530280">have</span> <span m="3530740">any</span> <span m="3530970">multiple</span> <span m="3531270">of</span> <span m="3531570">those.</span> <span m="3531770">So</span> <span m="3531970">we</span> <span m="3532090">can</span> <span m="3532560">reach</span> <span m="3532930">any</span> <span m="3533180">multiple</span> <span m="3533810">1.</span> <span m="3534970">That's</span> <span m="3535230">very</span> <span m="3535570">special.</span> <span m="3536180">So</span> <span m="3536210">this</span> <span m="3536430">particular</span> <span m="3536890">case,</span> <span m="3537680">we</span> <span m="3537720">know</span> <span m="3538500">that</span> <span m="3539000">any</span> <span m="3539240">multiple</span> <span m="3539730">of</span> <span m="3539820">1,</span> <span m="3540240">any</span> <span m="3540750">number</span> <span m="3541020">of gallons</span> <span m="3541510">can</span> <span m="3541670">be</span> <span m="3541800">reached.</span> </p>
<p><span m="3543100">So</span> <span m="3543260">can</span> <span m="3543450">we</span> <span m="3543640">sort</span> <span m="3543860">of</span> <span m="3543940">generalize</span> <span m="3544540">this</span> <span m="3544730">a</span> <span m="3544790">little</span> <span m="3545050">bit</span> <span m="3546270">by</span> <span m="3546380">using</span> <span m="3546650">the</span> <span m="3546740">greatest</span> <span m="3547120">common</span> <span m="3547350">divisor?</span> <span m="3548050">So</span> <span m="3548080">the</span> <span m="3548180">greatest</span> <span m="3548540">common</span> <span m="3548730">divisor</span> <span m="3549530">3</span> <span m="3549890">and</span> <span m="3550000">5 is</span> <span m="3550480">equal</span> <span m="3550760">to</span> <span m="3550910">1.</span> <span m="3551680">And</span> <span m="3551880">we</span> <span m="3552710">have</span> <span m="3552840">shown</span> <span m="3553400">that</span> <span m="3554700">the</span> <span m="3554790">greatest</span> <span m="3555190">common</span> <span m="3555400">divisor</span> <span m="3556180">defies</span> <span m="3556700">any</span> <span m="3556930">result.</span> <span m="3557910">Can</span> <span m="3558080">we</span> <span m="3558190">say</span> <span m="3558420">something</span> <span m="3558800">more?</span> <span m="3559000">Can</span> <span m="3559130">we</span> <span m="3559240">say</span> <span m="3559550">that</span> <span m="3560280">the</span> <span m="3560420">greatest</span> <span m="3560840">common</span> <span m="3561320">divisor</span> <span m="3561840">can</span> <span m="3562020">be</span> <span m="3562140">maybe</span> <span m="3562970">written</span> <span m="3563470">as</span> <span m="3563760">a</span> <span m="3563800">linear</span> <span m="3564120">combination</span> <span m="3565040">of</span> <span m="3565220">this</span> <span m="3565610">type</span> <span m="3565930">over</span> <span m="3566230">there?</span> <span m="3566830">And</span> <span m="3567000">that's</span> <span m="3567210">how</span> <span m="3567380">we</span> <span m="3567570">are</span> <span m="3568070">going</span> <span m="3568320">to</span> <span m="3568510">proceed now.</span> </p>
<p><span m="3570610">So</span> <span m="3570870">let's</span> <span m="3571160">set</span> <span m="3575350">talk</span> <span m="3575660">about</span> <span m="3575910">the</span> <span m="3576040">very</span> <span m="3576250">special</span> <span m="3577880">algorithm</span> <span m="3580000">which</span> <span m="3580300">is</span> <span m="3580500">called</span> <span m="3581440">Euclid's</span> <span m="3581920">algorithm.</span> <span m="3583240">And</span> <span m="3583550">I</span> <span m="3583590">think</span> <span m="3583910">in</span> <span m="3584080">the</span> <span m="3584310">book</span> <span m="3584710">it's</span> <span m="3584910">also</span> <span m="3585190">called</span> <span m="3585550">The</span> <span m="3585680">Pulverizer.</span> <span m="3587410">And</span> <span m="3587910">you</span> <span m="3588040">will</span> <span m="3588330">have</span> <span m="3589240">a</span> <span m="3589360">problem</span> <span m="3589780">on</span> <span m="3589950">this</span> <span m="3590940">just</span> <span m="3591620">to</span> <span m="3592110">see</span> <span m="3592360">how</span> <span m="3592610">that</span> <span m="3592790">works,</span> <span m="3593390">and</span> <span m="3593550">to</span> <span m="3593790">really</span> <span m="3594070">understand</span> <span m="3594580">it.</span> <span m="3595660">So</span> <span m="3595860">let's</span> <span m="3596020">explain</span> <span m="3596970">what</span> <span m="3597380">we</span> <span m="3597520">want</span> <span m="3597790">here.</span> </p>
<p><span m="3599100">So</span> <span m="3599180">first</span> <span m="3599520">of</span> <span m="3599690">all,</span> <span m="3601410">we</span> <span m="3601430">know</span> <span m="3602070">that</span> <span m="3603370">for</span> <span m="3603770">any</span> <span m="3604050">b and</span> <span m="3604480">a,</span> <span m="3605390">there</span> <span m="3605540">exists</span> <span m="3606190">a</span> <span m="3606410">unique</span> <span m="3606870">quotient</span> <span m="3607420">and</span> <span m="3607600">remainder</span> <span m="3608110">r.</span> <span m="3608580">So</span> <span m="3608830">let's</span> <span m="3609085">write it</span> <span m="3609340">out.</span> <span m="3611740">There</span> <span m="3611910">exists</span> <span m="3614210">unique</span> <span m="3617090">q,</span> <span m="3617290">which</span> <span m="3617760">we</span> <span m="3618290">will</span> <span m="3618800">call</span> <span m="3619720">the</span> <span m="3619850">quotient.</span> </p>
<p></p>
<p><span m="3625280">And</span> <span m="3625540">r.</span> <span m="3626740">We call</span> <span m="3627190">this</span> <span m="3627360">the</span> <span m="3627430">remainder.</span> </p>
<p></p>
<p><span m="3633280">Such</span> <span m="3633410">that</span> <span m="3637610">b</span> <span m="3638020">equals</span> <span m="3639970">q</span> <span m="3640270">times</span> <span m="3640670">a,</span> <span m="3642480">plus</span> <span m="3643090">r.</span> <span m="3644670">With</span> <span m="3644910">the</span> <span m="3645370">property</span> <span m="3648020">that</span> <span m="3648920">0</span> <span m="3650350">is</span> <span m="3650550">at</span> <span m="3650680">least</span> <span m="3651000">r,</span> <span m="3651305">and</span> <span m="3651610">at</span> <span m="3651970">most a.</span> <span m="3654380">So</span> <span m="3655360">we're</span> <span m="3656350">not</span> <span m="3656470">going to</span> <span m="3656870">prove</span> <span m="3657930">this</span> <span m="3658090">statement.</span> <span m="3658630">It's actually</span> <span m="3659100">like</span> <span m="3659310">a</span> <span m="3659370">theorem,</span> <span m="3659830">right?</span> <span m="3660160">But</span> <span m="3660920">let's</span> <span m="3661130">just</span> <span m="3661320">assume</span> <span m="3661690">it</span> <span m="3661790">for</span> <span m="3661960">now.</span> <span m="3662390">And</span> <span m="3662540">in</span> <span m="3662630">the</span> <span m="3662720">book</span> <span m="3662940">you</span> <span m="3663020">can</span> <span m="3663190">read</span> <span m="3663390">about</span> <span m="3663730">it.</span> </p>
<p><span m="3667805">We're</span> <span m="3668230">going</span> <span m="3668400">to</span> <span m="3668550">use</span> <span m="3668930">this</span> <span m="3670230">to</span> <span m="3670390">prove</span> <span m="3671910">the</span> <span m="3672010">following</span> <span m="3672450">lemma</span> <span m="3672720">that</span> <span m="3673020">we</span> <span m="3673110">will</span> <span m="3673470">need</span> <span m="3673890">to</span> <span m="3674390">give</span> <span m="3674540">a</span> <span m="3674640">characterization</span> <span m="3675030">of</span> <span m="3675530">the</span> <span m="3675610">greatest</span> <span m="3676030">common</span> <span m="3676310">divisor,</span> <span m="3676930">as</span> <span m="3677130">a</span> <span m="3677170">linear</span> <span m="3677520">combination</span> <span m="3678090">of</span> <span m="3679870">integers.</span> </p>
<p><span m="3683280">Oh,</span> <span m="3683420">before</span> <span m="3684250">I</span> <span m="3684380">forget,</span> <span m="3685780">you</span> <span m="3685970">will</span> <span m="3686110">denote</span> <span m="3686740">this</span> <span m="3686980">remainder</span> <span m="3688040">as</span> <span m="3689050">rem</span> <span m="3690410">of</span> <span m="3692130">b,</span> <span m="3693590">a.</span> <span m="3694400">And this</span> <span m="3694550">is</span> <span m="3694690">the</span> <span m="3694780">notation</span> <span m="3695320">that</span> <span m="3695420">we</span> <span m="3695510">use</span> <span m="3695840">in</span> <span m="3696910">this</span> <span m="3697070">lecture.</span> </p>
<p><span m="3698930">So</span> <span m="3699140">what's</span> <span m="3699380">the lemma?</span> <span m="3700090">The lemma</span> <span m="3700510">is</span> <span m="3701310">that</span> <span m="3701480">the</span> <span m="3701560">greatest</span> <span m="3702120">common</span> <span m="3702370">divisor</span> <span m="3703780">of a</span> <span m="3704170">and</span> <span m="3704910">b,</span> <span m="3706730">is</span> <span m="3706930">equal</span> <span m="3707290">to</span> <span m="3707430">the</span> <span m="3707580">greatest</span> <span m="3708050">common</span> <span m="3708280">divisor</span> <span m="3709250">of</span> <span m="3709890">the</span> <span m="3710010">remainder</span> <span m="3711840">of</span> <span m="3712080">b</span> <span m="3712790">and</span> <span m="3713010">a.</span> <span m="3716180">With</span> <span m="3716320">a.</span> <span m="3716590">So</span> <span m="3717040">what</span> <span m="3717280">did</span> <span m="3717440">we do?</span> <span m="3718420">Let's</span> <span m="3718650">give</span> <span m="3718830">an</span> <span m="3718910">example</span> <span m="3719500">to</span> <span m="3719600">see</span> <span m="3719770">how</span> <span m="3719940">this</span> <span m="3720120">works.</span> </p>
<p><span m="3722810">For</span> <span m="3723230">example,</span> <span m="3723950">let's</span> <span m="3724470">take--</span> <span m="3726230">actually</span> <span m="3726680">let's do</span> <span m="3727120">it on</span> <span m="3727320">this</span> <span m="3728120">white board.</span> </p>
<p></p>
<p><span m="3734678">So,</span> <span m="3735177">let's</span> <span m="3735676">see.</span> </p>
<p><span m="3739670">For</span> <span m="3739810">example,</span> <span m="3740210">let's</span> <span m="3740600">see</span> <span m="3740970">whether we</span> <span m="3741040">can</span> <span m="3741260">use</span> <span m="3741600">this</span> <span m="3742390">to</span> <span m="3742520">calculate</span> <span m="3743340">the</span> <span m="3743420">greatest</span> <span m="3743900">common</span> <span m="3744120">divisor</span> <span m="3745770">105,</span> <span m="3747590">and</span> <span m="3748620">224.</span> </p>
<p></p>
<p><span m="3751260">So</span> <span m="3751420">how</span> <span m="3751600">can</span> <span m="3751720">we</span> <span m="3751830">go</span> <span m="3752090">ahead?</span> <span m="3753250">Well,</span> <span m="3755440">according</span> <span m="3755830">to</span> <span m="3755970">this</span> <span m="3756160">lemma,</span> <span m="3757430">we</span> <span m="3758000">can</span> <span m="3758260">rewrite</span> <span m="3758790">this</span> <span m="3759500">as</span> <span m="3760050">the</span> <span m="3760150">greatest</span> <span m="3760550">common</span> <span m="3760770">divisor</span> <span m="3761430">of</span> <span m="3761660">first</span> <span m="3763360">the</span> <span m="3763470">remainder</span> <span m="3765030">of</span> <span m="3766920">224,</span> <span m="3768360">after</span> <span m="3768690">dividing</span> <span m="3769280">out</span> <span m="3769720">as</span> <span m="3769920">many</span> <span m="3770190">multiples</span> <span m="3770475">of</span> <span m="3770760">105</span> <span m="3772160">as</span> <span m="3772330">possible.</span> <span m="3774690">And</span> <span m="3774890">105.</span> </p>
<p></p>
<p><span m="3778000">So</span> <span m="3778970">what</span> <span m="3779200">are</span> <span m="3779290">we</span> <span m="3779400">going</span> <span m="3779620">to</span> <span m="3779820">use</span> <span m="3780120">here?</span> <span m="3781640">We're</span> <span m="3781750">going</span> <span m="3781950">to</span> <span m="3782120">use</span> <span m="3784490">that</span> <span m="3784680">224</span> <span m="3785530">is</span> <span m="3785710">actually</span> <span m="3786070">equal</span> <span m="3786540">to</span> <span m="3786750">2</span> <span m="3787010">times</span> <span m="3788150">105,</span> <span m="3789370">plus</span> <span m="3790400">14.</span> </p>
<p></p>
<p><span m="3794070">So</span> <span m="3794190">we</span> <span m="3794430">had the</span> <span m="3794510">GCD</span> <span m="3795090">of</span> <span m="3795390">14 and 105.</span> <span m="3798340">Now</span> <span m="3798480">why</span> <span m="3798710">can</span> <span m="3798990">I</span> <span m="3799060">do</span> <span m="3799320">this?</span> <span m="3800490">Well,</span> <span m="3802880">I'm</span> <span m="3803050">essentially</span> <span m="3803640">just</span> <span m="3803860">subtracting</span> <span m="3805400">like</span> <span m="3805870">2</span> <span m="3806090">times</span> <span m="3807260">135</span> <span m="3808540">from</span> <span m="3809010">224.</span> <span m="3810850">Well,</span> <span m="3810980">the</span> <span m="3811070">greatest</span> <span m="3811510">common</span> <span m="3811740">divisor</span> <span m="3812320">that</span> <span m="3812610">divides</span> <span m="3813564">105</span> <span m="3814520">and</span> <span m="3814800">224</span> <span m="3816120">also</span> <span m="3816480">divides</span> <span m="3818510">105,</span> <span m="3820050">and</span> <span m="3820310">a</span> <span m="3820350">linear</span> <span m="3820650">combination</span> <span m="3821290">of</span> <span m="3821440">105,</span> <span m="3822880">224.</span> <span m="3823700">That's</span> <span m="3823900">essentially</span> <span m="3824390">what</span> <span m="3824560">we are</span> <span m="3824800">using.</span> <span m="3826430">And that's</span> <span m="3827310">actually</span> <span m="3827880">stated</span> <span m="3828340">in</span> <span m="3828430">this</span> <span m="3828610">lemma,</span> <span m="3829370">and</span> <span m="3829520">that's</span> <span m="3829680">what</span> <span m="3829820">we</span> <span m="3829950">would</span> <span m="3830060">like</span> <span m="3830260">to</span> <span m="3830370">prove.</span> </p>
<p><span m="3832840">So</span> <span m="3832930">let's</span> <span m="3833130">continue</span> <span m="3833465">with</span> <span m="3833800">this</span> <span m="3834020">process,</span> <span m="3835370">and</span> <span m="3836410">do</span> <span m="3836510">the</span> <span m="3836620">same</span> <span m="3836920">trick</span> <span m="3837190">once</span> <span m="3837450">more.</span> <span m="3838330">So</span> <span m="3838510">we</span> <span m="3838630">can</span> <span m="3838780">say</span> <span m="3839790">that</span> <span m="3840290">we</span> <span m="3840370">can</span> <span m="3840550">rewrite</span> <span m="3841030">this</span> <span m="3841820">as</span> <span m="3843310">the</span> <span m="3843420">greatest</span> <span m="3843900">common</span> <span m="3844150">divisor</span> <span m="3846780">of,</span> <span m="3847380">well,</span> <span m="3848270">the</span> <span m="3848380">remainder</span> <span m="3849940">of</span> <span m="3853190">105</span> <span m="3854660">after</span> <span m="3855790">taking</span> <span m="3856170">out</span> <span m="3856300">this</span> <span m="3856460">many</span> <span m="3856750">multiples</span> <span m="3857460">of</span> <span m="3857610">14</span> <span m="3858560">as</span> <span m="3858780">possible,</span> <span m="3860150">and</span> <span m="3860380">14.</span> <span m="3862580">So</span> <span m="3863580">what</span> <span m="3863700">are we</span> <span m="3863950">going</span> <span m="3864120">to</span> <span m="3864260">use</span> <span m="3864580">over</span> <span m="3864850">here?</span> <span m="3865720">We are</span> <span m="3865900">going</span> <span m="3866150">to</span> <span m="3866390">use</span> <span m="3866800">that</span> <span m="3866970">105</span> <span m="3868040">is</span> <span m="3868310">equal</span> <span m="3868740">to</span> <span m="3869840">7</span> <span m="3870510">times</span> <span m="3870880">14,</span> <span m="3872270">plus</span> <span m="3872580">7.</span> <span m="3874200">So</span> <span m="3874390">this</span> <span m="3874590">is</span> <span m="3874720">the</span> <span m="3874800">greatest</span> <span m="3875190">common</span> <span m="3875390">divisor</span> <span m="3876260">of</span> <span m="3876530">7,</span> <span m="3877500">and</span> <span m="3878500">14.</span> <span m="3880580">Now</span> <span m="3880690">if</span> <span m="3880810">you</span> <span m="3881270">just</span> <span m="3882040">continue</span> <span m="3882540">this</span> <span m="3884310">process,</span> <span m="3885550">we</span> <span m="3885580">can</span> <span m="3885760">see</span> <span m="3886270">that</span> <span m="3887060">this</span> <span m="3887230">is</span> <span m="3887350">equal</span> <span m="3887590">to</span> <span m="3887680">the</span> <span m="3887790">greatest</span> <span m="3888200">common</span> <span m="3888380">divisor,</span> <span m="3889230">again,</span> <span m="3889680">of</span> <span m="3890750">the</span> <span m="3890850">remainder</span> <span m="3892000">of</span> <span m="3892240">now</span> <span m="3892910">14,</span> <span m="3893760">after</span> <span m="3894110">dividing</span> <span m="3894620">out</span> <span m="3894780">as</span> <span m="3894950">many</span> <span m="3895190">multiples</span> <span m="3895750">of</span> <span m="3895830">7</span> <span m="3897490">with</span> <span m="3897870">7.</span> </p>
<p><span m="3900090">Now</span> <span m="3900930">this</span> <span m="3901230">is</span> <span m="3901360">equal</span> <span m="3903180">to</span> <span m="3903300">0,</span> <span m="3905100">7.</span> <span m="3905630">Why is</span> <span m="3905950">that?</span> <span m="3906180">Because</span> <span m="3907260">14</span> <span m="3911910">is</span> <span m="3912120">equal</span> <span m="3912370">to</span> <span m="3912560">2</span> <span m="3912760">times</span> <span m="3913080">7,</span> <span m="3913410">plus</span> <span m="3913700">0.</span> <span m="3914630">So</span> <span m="3914800">0</span> <span m="3915230">is</span> <span m="3915400">the</span> <span m="3915480">remainder</span> <span m="3916590">after</span> <span m="3916990">dividing</span> <span m="3917510">out</span> <span m="3918940">7</span> <span m="3919320">as</span> <span m="3919470">many</span> <span m="3919980">possible</span> <span m="3920410">times</span> <span m="3920690">as</span> <span m="3920810">possible.</span> <span m="3921750">OK.</span> <span m="3922010">So</span> <span m="3922460">we</span> <span m="3922640">have the</span> <span m="3922760">greatest</span> <span m="3923120">common</span> <span m="3923300">divisor</span> <span m="3923760">of 0,</span> <span m="3924170">and</span> <span m="3924260">7.</span> <span m="3925180">What's</span> <span m="3925420">the</span> <span m="3925530">largest</span> <span m="3926820">integer</span> <span m="3927000">that</span> <span m="3927540">can</span> <span m="3927700">divide</span> <span m="3928090">both</span> <span m="3928380">0 and</span> <span m="3928730">7?</span> <span m="3928950">Well,</span> <span m="3929480">any</span> <span m="3929830">integer</span> <span m="3930310">can</span> <span m="3930550">divide</span> <span m="3931400">0.</span> <span m="3932590">So</span> <span m="3933720">we</span> <span m="3933830">know that this</span> <span m="3934140">is</span> <span m="3934460">equal</span> <span m="3934690">to</span> <span m="3934800">7.</span> <span m="3936280">So</span> <span m="3936450">essentially,</span> <span m="3937010">what</span> <span m="3937190">we</span> <span m="3937290">have</span> <span m="3937510">done</span> <span m="3937720">here,</span> <span m="3938590">we</span> <span m="3938750">have</span> <span m="3939200">repeatedly</span> <span m="3939890">used</span> <span m="3940590">this</span> <span m="3940790">particular</span> <span m="3941250">lemma</span> <span m="3942600">to</span> <span m="3942760">compute</span> <span m="3943560">in the end,</span> <span m="3944110">the</span> <span m="3944190">greatest</span> <span m="3944630">common</span> <span m="3944840">divisor</span> <span m="3946780">of</span> <span m="3948280">105</span> <span m="3949360">and</span> <span m="3949580">224.</span> </p>
<p><span m="3951290">And</span> <span m="3951310">we</span> <span m="3951430">have</span> <span m="3952980">been</span> <span m="3953520">very</span> <span m="3953760">methodol--</span> <span m="3954690">we</span> <span m="3955055">have</span> <span m="3955420">used</span> <span m="3955610">a</span> <span m="3956080">specific</span> <span m="3956550">method.</span> <span m="3957030">We</span> <span m="3957720">used</span> <span m="3958010">the</span> <span m="3958110">lemma,</span> <span m="3959910">and</span> <span m="3960010">we</span> <span m="3960150">worked</span> <span m="3960440">it</span> <span m="3960570">out.</span> <span m="3961490">We</span> <span m="3961600">used</span> <span m="3961840">the lemma</span> <span m="3962100">again,</span> <span m="3962920">and</span> <span m="3963220">we</span> <span m="3963830">just</span> <span m="3964120">plugged</span> <span m="3964300">in</span> <span m="3964400">the</span> <span m="3964500">actual</span> <span m="3964860">numbers.</span> <span m="3965880">Used</span> <span m="3966100">to</span> <span m="3966170">lemma</span> <span m="3966370">again.</span> <span m="3966860">Plugged</span> <span m="3967140">in</span> <span m="3967250">the</span> <span m="3967370">actual</span> <span m="3967710">numbers,</span> <span m="3968040">and</span> <span m="3968210">so</span> <span m="3968430">on.</span> <span m="3969860">And</span> <span m="3970000">this</span> <span m="3970210">is</span> <span m="3970390">what</span> <span m="3970570">is</span> <span m="3971100">called</span> <span m="3971770">Euclid's</span> <span m="3972420">algorithm.</span> <span m="3974020">And in</span> <span m="3974190">the</span> <span m="3974270">book</span> <span m="3974500">it's</span> <span m="3974960">also</span> <span m="3975280">called</span> <span m="3976200">The</span> <span m="3976420">Pulverizer.</span> <span m="3976910">And</span> <span m="3976970">there's,</span> <span m="3977690">I</span> <span m="3977750">think,</span> <span m="3978010">a</span> <span m="3978110">few</span> <span m="3978290">other</span> <span m="3978440">names.</span> <span m="3980270">But</span> <span m="3980460">I</span> <span m="3980520">like</span> <span m="3980740">this</span> <span m="3980980">one.</span> </p>
<p><span m="3983190">So</span> <span m="3983330">this</span> <span m="3983580">is</span> <span m="3983690">an</span> <span m="3983790">example</span> <span m="3985510">of</span> <span m="3985930">Euclid's</span> <span m="3986770">algorithm.</span> <span m="3989010">So</span> <span m="3989190">now</span> <span m="3989330">let's</span> <span m="3990460">have</span> <span m="3990690">to</span> <span m="3990830">look</span> <span m="3991030">whether</span> <span m="3991210">we</span> <span m="3991370">can</span> <span m="3991700">have</span> <span m="3991930">prove</span> <span m="3992990">this</span> <span m="3993200">particular</span> <span m="3993640">lemma,</span> <span m="3995660">and</span> <span m="3999040">actually</span> <span m="3999770">I will--</span> <span m="4001910">Yep.</span> <span m="4002970">We're</span> <span m="4003460">going to</span> <span m="4003950">prove</span> <span m="4004440">this lemma.</span> </p>
<p></p>
<p><span m="4015240">OK.</span> <span m="4016030">So</span> <span m="4018800">how do</span> <span m="4019230">we</span> <span m="4019410">do</span> <span m="4019530">the</span> <span m="4019660">proof?</span> <span m="4021190">Well,</span> <span m="4021340">first</span> <span m="4021620">before</span> <span m="4021920">we</span> <span m="4022040">know</span> <span m="4022260">that</span> <span m="4023510">if-</span> <span m="4025130">yeah.</span> <span m="4025640">Well,</span> <span m="4025850">how</span> <span m="4026030">do</span> <span m="4026120">we</span> <span m="4026210">do</span> <span m="4026340">this?</span> <span m="4026840">You</span> <span m="4026960">would</span> <span m="4027100">like</span> <span m="4027300">to</span> <span m="4027430">prove</span> <span m="4027910">that</span> <span m="4028510">if</span> <span m="4028890">the</span> <span m="4028980">great--</span> <span m="4029340">well,</span> <span m="4029700">if</span> <span m="4030080">n</span> <span m="4030350">divides</span> <span m="4030480">a and b,</span> <span m="4032190">in</span> <span m="4032570">particular,</span> <span m="4032930">the</span> <span m="4033050">greatest</span> <span m="4033380">common</span> <span m="4033570">divisor</span> <span m="4035170">divides</span> <span m="4035990">a</span> <span m="4036340">and</span> <span m="4036490">b.</span> <span m="4037360">We</span> <span m="4037480">would</span> <span m="4037600">like</span> <span m="4037800">to</span> <span m="4037890">show</span> <span m="4038560">that</span> <span m="4039280">it's</span> <span m="4040570">dividing</span> <span m="4041220">also</span> <span m="4041910">the</span> <span m="4042010">remainder</span> <span m="4043090">of b,</span> <span m="4043570">after</span> <span m="4043920">dividing</span> <span m="4044390">out</span> <span m="4044550">a,</span> <span m="4045420">and</span> <span m="4045630">a</span> <span m="4045870">itself.</span> <span m="4047890">If</span> <span m="4048010">you</span> <span m="4048090">can</span> <span m="4048220">show</span> <span m="4048550">that,</span> <span m="4049040">then</span> <span m="4049450">we</span> <span m="4049560">know</span> <span m="4050200">that</span> <span m="4051470">the</span> <span m="4051560">greatest</span> <span m="4051900">common</span> <span m="4052090">divisor</span> <span m="4052355">of</span> <span m="4052620">this</span> <span m="4052910">thing</span> <span m="4053330">is</span> <span m="4053600">at</span> <span m="4053740">least</span> <span m="4054440">what</span> <span m="4054660">we</span> <span m="4054730">have</span> <span m="4054970">over</span> <span m="4055260">here.</span> </p>
<p><span m="4055740">So</span> <span m="4055790">I</span> <span m="4055860">said</span> <span m="4056120">a</span> <span m="4056200">lot</span> <span m="4056430">right</span> <span m="4056690">now.</span> <span m="4057370">So</span> <span m="4057620">let's</span> <span m="4057860">try</span> <span m="4058080">to</span> <span m="4059040">write</span> <span m="4059270">it</span> <span m="4059420">out</span> <span m="4059640">a</span> <span m="4059670">little</span> <span m="4059930">bit.</span> <span m="4060210">So</span> <span m="4060350">suppose</span> <span m="4060840">that</span> <span m="4061020">m</span> <span m="4061280">is</span> <span m="4061460">any</span> <span m="4061770">divisor</span> <span m="4062220">of</span> <span m="4062430">a.</span> <span m="4064860">And</span> <span m="4065300">at</span> <span m="4065470">the</span> <span m="4065540">same</span> <span m="4065900">time,</span> <span m="4066340">m</span> <span m="4066920">also</span> <span m="4067710">divides</span> <span m="4067820">b.</span> </p>
<p></p>
<p><span m="4071690">Well,</span> <span m="4073330">then</span> <span m="4073520">I</span> <span m="4073590">know</span> <span m="4075360">that m</span> <span m="4075800">also</span> <span m="4076170">divides</span> <span m="4077920">b</span> <span m="4078270">minus,</span> <span m="4079060">say,</span> <span m="4079290">the</span> <span m="4079460">quotient,</span> <span m="4080100">q</span> <span m="4080410">that</span> <span m="4080530">we</span> <span m="4080650">had</span> <span m="4080890">over</span> <span m="4081150">here,</span> <span m="4081690">times</span> <span m="4082150">a.</span> <span m="4084520">And--</span> <span m="4085760">and</span> <span m="4085920">this</span> <span m="4086090">is</span> <span m="4086210">actually</span> <span m="4086730">equal</span> <span m="4087060">to</span> <span m="4087180">the</span> <span m="4087300">remainder</span> <span m="4088570">of</span> <span m="4088760">b</span> <span m="4089060">and</span> <span m="4089360">a.</span> <span m="4091250">Now we</span> <span m="4091430">also</span> <span m="4091690">note</span> <span m="4092560">that</span> <span m="4093170">m</span> <span m="4093260">divides</span> <span m="4093750">a.</span> <span m="4094950">So</span> <span m="4095120">what</span> <span m="4095220">did</span> <span m="4095400">we</span> <span m="4095480">show</span> <span m="4095850">here?</span> <span m="4096210">We showed</span> <span m="4096939">that</span> <span m="4097359">if</span> <span m="4098529">m</span> <span m="4098960">divides,</span> <span m="4099569">and</span> <span m="4100295">m</span> <span m="4100660">divides</span> <span m="4101109">b,</span> <span m="4101740">then</span> <span m="4102130">m</span> <span m="4102439">also</span> <span m="4102810">divides</span> <span m="4103149">the</span> <span m="4103460">remainder</span> <span m="4103770">of</span> <span m="4104200">b</span> <span m="4104470">and</span> <span m="4104863">a.</span> <span m="4105649">And</span> <span m="4106090">n</span> <span m="4106300">divides</span> <span m="4106420">a.</span> </p>
<p><span m="4107700">So</span> <span m="4107939">what</span> <span m="4108069">does</span> <span m="4108290">is</span> <span m="4108470">prove?</span> <span m="4109790">Well,</span> <span m="4110040">it</span> <span m="4110180">proves</span> <span m="4110609">that,</span> <span m="4111330">in</span> <span m="4111450">particular,</span> <span m="4112370">the</span> <span m="4112540">greatest</span> <span m="4113069">common</span> <span m="4113330">divisor</span> <span m="4113939">over</span> <span m="4114210">here</span> <span m="4114670">divides</span> <span m="4115250">this</span> <span m="4115510">one.</span> <span m="4116470">That's</span> <span m="4116740">interesting.</span> <span m="4117859">That</span> <span m="4118149">essentially</span> <span m="4118710">means</span> <span m="4119060">that</span> <span m="4119180">we</span> <span m="4119279">have</span> <span m="4119479">shown</span> <span m="4120850">this</span> <span m="4121060">inequality.</span> <span m="4122930">Because</span> <span m="4125529">if</span> <span m="4126950">this</span> <span m="4127279">one</span> <span m="4127500">divides</span> <span m="4128069">this,</span> <span m="4129180">well,</span> <span m="4130200">that</span> <span m="4130290">means</span> <span m="4130529">that</span> <span m="4131020">this</span> <span m="4131270">number</span> <span m="4131540">over</span> <span m="4131779">here</span> <span m="4131970">must</span> <span m="4132170">be</span> <span m="4132300">at</span> <span m="4132460">least</span> <span m="4133200">what</span> <span m="4133359">we</span> <span m="4133470">have</span> <span m="4133740">over</span> <span m="4134000">here.</span> </p>
<p><span m="4135569">OK.</span> <span m="4136399">So</span> <span m="4136660">let's</span> <span m="4138040">continue.</span> </p>
<p></p>
<p><span m="4147620">We consider</span> <span m="4147979">two</span> <span m="4148240">cases.</span> <span m="4149080">If</span> <span m="4149279">the</span> <span m="4149370">remainder</span> <span m="4149939">of</span> <span m="4150109">b and</span> <span m="4150399">a</span> <span m="4150790">is</span> <span m="4151260">unequal</span> <span m="4151540">to</span> <span m="4151640">0,</span> <span m="4154330">well,</span> <span m="4154439">what</span> <span m="4154609">can</span> <span m="4154760">we</span> <span m="4154850">say</span> <span m="4155120">now?</span> <span m="4157600">We</span> <span m="4157750">can</span> <span m="4157910">say</span> <span m="4158270">that</span> <span m="4159569">if</span> <span m="4159770">I</span> <span m="4159850">know</span> <span m="4160160">that</span> <span m="4160390">m</span> <span m="4160720">divides</span> <span m="4161859">this</span> <span m="4162149">remainder</span> <span m="4164060">of</span> <span m="4164450">b</span> <span m="4164800">and a,</span> <span m="4165439">which</span> <span m="4165689">can</span> <span m="4165840">be</span> <span m="4165990">rewritten</span> <span m="4166569">as</span> <span m="4166770">b</span> <span m="4166960">minus</span> <span m="4167370">q,</span> <span m="4167569">times</span> <span m="4168010">a.</span> <span m="4169819">And</span> <span m="4170380">I</span> <span m="4170569">also</span> <span m="4170819">note</span> <span m="4171260">that--</span> <span m="4172390">if I</span> <span m="4172479">also</span> <span m="4172670">know</span> <span m="4172950">that n</span> <span m="4173160">divides</span> <span m="4173859">a,</span> <span m="4177569">then</span> <span m="4177740">this</span> <span m="4177960">actually</span> <span m="4178520">implies</span> <span m="4180250">the</span> <span m="4180530">reverse</span> <span m="4180810">of</span> <span m="4180930">this</span> <span m="4181029">statement,</span> <span m="4181710">that n</span> <span m="4182000">divides</span> <span m="4182739">a,</span> <span m="4183120">and</span> <span m="4183490">divides</span> <span m="4183890">b.</span> </p>
<p><span m="4185290">Now</span> <span m="4185410">why</span> <span m="4185609">is</span> <span m="4185770">that?</span> <span m="4186910">Well, we're</span> <span m="4187170">actually</span> <span m="4188029">using</span> <span m="4188500">the</span> <span m="4188609">fact</span> <span m="4189439">that</span> <span m="4189680">if n</span> <span m="4189970">divides</span> <span m="4190430">b,</span> <span m="4191060">minus</span> <span m="4191479">q,</span> <span m="4191620">times</span> <span m="4191960">a,</span> <span m="4192200">and m</span> <span m="4192580">divides</span> <span m="4192970">a,</span> <span m="4193960">then</span> <span m="4194350">m</span> <span m="4194660">also</span> <span m="4195380">defies</span> <span m="4195890">any</span> <span m="4196080">linear</span> <span m="4196380">combination</span> <span m="4196990">of</span> <span m="4197130">these</span> <span m="4197360">two.</span> <span m="4197680">In</span> <span m="4197810">particular,</span> <span m="4199560">this</span> <span m="4200090">plus</span> <span m="4200490">q,</span> <span m="4200720">times</span> <span m="4201060">a,</span> <span m="4202190">which</span> <span m="4202440">is</span> <span m="4204020">b.</span> <span m="4204620">m</span> <span m="4204945">divides</span> <span m="4205270">b.</span> </p>
<p><span m="4205710">So</span> <span m="4206330">maybe</span> <span m="4206490">I'm</span> <span m="4206640">going a</span> <span m="4206910">little bit</span> <span m="4207300">fast here,</span> <span m="4207840">I</span> <span m="4207980">notice.</span> <span m="4210780">This all</span> <span m="4211220">also</span> <span m="4211610">has</span> <span m="4211770">to</span> <span m="4211900">do</span> <span m="4212060">with</span> <span m="4212220">all</span> <span m="4212460">the</span> <span m="4214440">lecture</span> <span m="4214560">handouts.</span> <span m="4215000">You</span> <span m="4215090">see</span> <span m="4215280">a</span> <span m="4215320">few</span> <span m="4215540">facts</span> <span m="4215960">on</span> <span m="4216110">the</span> <span m="4216230">divisibility.</span> <span m="4217650">And in</span> <span m="4217810">particular,</span> <span m="4218900">item</span> <span m="4219210">number</span> <span m="4219490">three</span> <span m="4220330">that</span> <span m="4220600">talks</span> <span m="4220900">about</span> <span m="4222830">the</span> <span m="4223050">fact</span> <span m="4223380">that</span> <span m="4223560">I'm</span> <span m="4223720">using</span> <span m="4223900">here.</span> <span m="4224380">If</span> <span m="4224590">a</span> <span m="4224750">divides</span> <span m="4225240">b</span> <span m="4225690">on</span> <span m="4226090">your</span> <span m="4226190">handout,</span> <span m="4227030">and a</span> <span m="4227220">divides</span> <span m="4227710">c,</span> <span m="4228420">then</span> <span m="4228570">I know</span> <span m="4228650">that</span> <span m="4229060">a</span> <span m="4229220">divides</span> <span m="4229680">any</span> <span m="4229910">linear</span> <span m="4230220">combination</span> <span m="4231180">of</span> <span m="4231410">b</span> <span m="4231780">and</span> <span m="4232010">c.</span> <span m="4233800">So</span> <span m="4233950">that's</span> <span m="4234190">essentially</span> <span m="4234720">what</span> <span m="4234890">I'm</span> <span m="4235180">using</span> <span m="4235400">here</span> <span m="4235900">repeatedly.</span> </p>
<p><span m="4239090">OK</span> </p>
<p></p>
<p><span m="4243610">So</span> <span m="4243820">let's</span> <span m="4244290">look</span> <span m="4244930">at</span> <span m="4245520">the</span> <span m="4246280">other</span> <span m="4246540">case.</span> <span m="4248930">If</span> <span m="4249180">the</span> <span m="4249260">remainder</span> <span m="4249740">is</span> <span m="4249980">equal</span> <span m="4250260">to</span> <span m="4250350">0,</span> <span m="4252140">well,</span> <span m="4252340">then</span> <span m="4254170">I</span> <span m="4254290">actually</span> <span m="4254620">know</span> <span m="4254830">that</span> <span m="4255940">b</span> <span m="4256362">minus</span> <span m="4256784">q,</span> <span m="4257630">times a</span> <span m="4258150">is</span> <span m="4258340">equal</span> <span m="4258560">to</span> <span m="4258660">0.</span> <span m="4260540">Well,</span> <span m="4260800">if</span> <span m="4261040">I</span> <span m="4261100">know that</span> <span m="4261960">m</span> <span m="4262330">divides</span> <span m="4262650">a,</span> <span m="4266590">well,</span> <span m="4267780">then</span> <span m="4269620">since</span> <span m="4270110">0</span> <span m="4270690">equals</span> <span m="4271770">b</span> <span m="4271970">minus</span> <span m="4272330">q,</span> <span m="4272530">times</span> <span m="4272890">a,</span> <span m="4273180">I know</span> <span m="4273470">that</span> <span m="4275530">b</span> <span m="4275840">equals</span> <span m="4276380">q,</span> <span m="4276640">times</span> <span m="4277140">a.</span> <span m="4277450">So if m</span> <span m="4277830">divides</span> <span m="4278170">a,</span> <span m="4279260">I</span> <span m="4279460">also</span> <span m="4279760">now that</span> <span m="4280180">m</span> <span m="4280410">divides</span> <span m="4280920">b.</span> <span m="4283920">So</span> <span m="4284090">this</span> <span m="4284280">is</span> <span m="4284420">one</span> <span m="4284640">argument.</span> <span m="4285570">This is</span> <span m="4285750">another</span> <span m="4286090">one.</span> <span m="4287240">And this</span> <span m="4287320">was--</span> <span m="4288775">These</span> <span m="4289170">are</span> <span m="4289230">the</span> <span m="4289360">three</span> <span m="4289850">arguments</span> <span m="4290480">that</span> <span m="4290610">now</span> <span m="4290870">show</span> <span m="4291360">that</span> <span m="4292790">anything</span> <span m="4293120">that</span> <span m="4293510">divides</span> <span m="4294350">these</span> <span m="4294680">two</span> <span m="4295680">also</span> <span m="4295970">divides</span> <span m="4296425">a</span> <span m="4296880">and</span> <span m="4297180">b.</span> </p>
<p><span m="4297500">So</span> <span m="4297650">now</span> <span m="4297810">we</span> <span m="4297910">have</span> <span m="4298010">the</span> <span m="4298220">reverse</span> <span m="4298510">argument,</span> <span m="4298990">right?</span> <span m="4299230">So</span> <span m="4299640">this</span> <span m="4300120">greatest</span> <span m="4300520">common</span> <span m="4300740">divisor</span> <span m="4302210">divides</span> <span m="4302790">this</span> <span m="4303040">one</span> <span m="4303210">here,</span> <span m="4303590">and</span> <span m="4303820">this</span> <span m="4304030">one.</span> <span m="4305340">And</span> <span m="4305520">we</span> <span m="4305620">just</span> <span m="4305990">proved</span> <span m="4306450">that</span> <span m="4306710">it</span> <span m="4307060">divides</span> <span m="4307415">a</span> <span m="4307770">and</span> <span m="4308540">b,</span> <span m="4309030">and</span> <span m="4309180">so it</span> <span m="4309480">must</span> <span m="4309810">divides</span> <span m="4310140">the greatest</span> <span m="4310460">common</span> <span m="4310730">divisor</span> <span m="4311090">of</span> <span m="4311270">a and</span> <span m="4311460">b.</span> <span m="4311940">So</span> <span m="4312100">now</span> <span m="4312280">we</span> <span m="4312390">have</span> <span m="4312500">shown</span> <span m="4313180">the</span> <span m="4313360">other</span> <span m="4313590">inequality,</span> <span m="4315030">and</span> <span m="4315250">this</span> <span m="4315450">proves</span> <span m="4315720">equality.</span> <span m="4316190">So</span> <span m="4316330">you</span> <span m="4316430">should</span> <span m="4316640">definitely</span> <span m="4316990">look</span> <span m="4318020">this</span> <span m="4318230">up</span> <span m="4318380">in</span> <span m="4318480">your</span> <span m="4318590">lecture</span> <span m="4318890">notes.</span> </p>
<p></p>
<p><span m="4322110">So</span> <span m="4322300">now</span> <span m="4322570">we</span> <span m="4322720">can</span> <span m="4323260">finally</span> <span m="4323680">prove</span> <span m="4324510">this</span> <span m="4325020">beautiful</span> <span m="4325410">theorem</span> <span m="4325790">a</span> <span m="4327440">that</span> <span m="4327730">will</span> <span m="4327830">help</span> <span m="4328180">us</span> <span m="4328360">to</span> <span m="4328480">characterize</span> <span m="4332200">the--</span> <span m="4332630">actually,</span> <span m="4332895">let me</span> <span m="4333160">put</span> <span m="4333550">this</span> <span m="4333720">over</span> <span m="4333990">here.</span> </p>
<p></p>
<p><span m="4341600">So</span> <span m="4341770">the</span> <span m="4341950">final</span> <span m="4342370">theorem</span> <span m="4342640">that</span> <span m="4342860">we</span> <span m="4343010">prove</span> <span m="4343430">here</span> <span m="4344600">is</span> <span m="4345680">that</span> <span m="4346140">the</span> <span m="4346230">greatest</span> <span m="4346860">common</span> <span m="4347150">divisor</span> <span m="4348730">of</span> <span m="4348990">a and</span> <span m="4349480">b</span> <span m="4350630">is</span> <span m="4350840">actually</span> <span m="4351600">a</span> <span m="4351860">linear</span> <span m="4352330">combination</span> <span m="4356860">of</span> <span m="4357250">a and</span> <span m="4358010">b.</span> <span m="4360910">So</span> <span m="4361240">we're</span> <span m="4361380">going</span> <span m="4361560">to</span> <span m="4361720">use</span> <span m="4361990">this</span> <span m="4362130">algorithm</span> <span m="4362690">that</span> <span m="4362850">you</span> <span m="4363000">have</span> <span m="4363280">over here,</span> <span m="4365100">Euclid's</span> <span m="4365820">algorithm.</span> <span m="4367460">And</span> <span m="4369870">we</span> <span m="4370000">are</span> <span m="4370050">going</span> <span m="4370350">to</span> <span m="4370820">do</span> <span m="4370980">a</span> <span m="4371050">proof,</span> <span m="4371960">again,</span> <span m="4372320">by</span> <span m="4372540">induction.</span> <span m="4373860">And</span> <span m="4374000">we</span> <span m="4374130">use</span> <span m="4374330">an</span> <span m="4374390">invariance.</span> </p>
<p><span m="4375470">So</span> <span m="4375730">we use</span> <span m="4379202">a</span> <span m="4379610">similar</span> <span m="4380060">kind</span> <span m="4380450">of</span> <span m="4381070">strategy,</span> <span m="4381550">of</span> <span m="4381700">course.</span> <span m="4383360">The</span> <span m="4383620">invariance</span> <span m="4384500">that we are</span> <span m="4384850">going</span> <span m="4385040">to</span> <span m="4385200">use</span> <span m="4388770">says--</span> <span m="4392230">well,</span> <span m="4394470">if</span> <span m="4394710">Euclid's</span> <span m="4395230">algorithm</span> <span m="4401970">reaches</span> <span m="4405390">the</span> <span m="4405480">greatest</span> <span m="4406050">common</span> <span m="4406310">divisor</span> <span m="4406890">of</span> <span m="4407180">x</span> <span m="4407470">and y--</span> <span m="4409140">so</span> <span m="4409360">for</span> <span m="4409520">example,</span> <span m="4410150">it's</span> <span m="4410290">reach,</span> <span m="4411470">say,</span> <span m="4411820">7 or</span> <span m="4412233">14,</span> <span m="4413060">and</span> <span m="4413190">105,</span> <span m="4413990">for</span> <span m="4414140">example.</span> <span m="4416350">Then,</span> <span m="4418750">say,</span> <span m="4418950">after</span> <span m="4419290">n</span> <span m="4419770">steps</span> <span m="4425540">then</span> <span m="4425760">both</span> <span m="4426680">x</span> <span m="4427020">and</span> <span m="4427260">y</span> <span m="4427630">are</span> <span m="4427790">linear</span> <span m="4428190">combinations</span> <span m="4429580">of</span> <span m="4430545">a</span> <span m="4430960">and</span> <span m="4431240">b.</span> <span m="4431950">So</span> <span m="4432370">then</span> <span m="4433210">x</span> <span m="4433670">and</span> <span m="4433960">y</span> <span m="4437360">are</span> <span m="4437580">linear</span> <span m="4437780">combinations</span> <span m="4440700">of a</span> <span m="4441000">and</span> <span m="4441750">b.</span> </p>
<p><span m="4444370">And</span> <span m="4444660">at</span> <span m="4444730">the</span> <span m="4444820">same</span> <span m="4445130">time,</span> <span m="4445600">we</span> <span m="4445660">also</span> <span m="4446060">know</span> <span m="4447020">that</span> <span m="4447160">the</span> <span m="4447250">greatest</span> <span m="4447780">common</span> <span m="4448040">divisor</span> <span m="4449200">of</span> <span m="4449470">a and</span> <span m="4449940">b</span> <span m="4450270">is</span> <span m="4450480">equal</span> <span m="4450740">to</span> <span m="4450850">the</span> <span m="4450950">greatest</span> <span m="4451340">common</span> <span m="4451580">divisor</span> <span m="4452640">of</span> <span m="4452820">x</span> <span m="4453430">and</span> <span m="4453670">y.</span> <span m="4455020">So</span> <span m="4455200">this</span> <span m="4455450">is</span> <span m="4455570">my</span> <span m="4456000">invariance.</span> <span m="4457390">And</span> <span m="4458800">the</span> <span m="4459040">way</span> <span m="4459280">I</span> <span m="4459420">will</span> <span m="4459590">go</span> <span m="4459850">ahead</span> <span m="4460450">is</span> <span m="4460720">to</span> <span m="4461860">simply</span> <span m="4462300">do</span> <span m="4462550">what</span> <span m="4463760">you do</span> <span m="4464040">always</span> <span m="4464540">in</span> <span m="4464900">these</span> <span m="4465050">situations.</span> </p>
<p><span m="4465650">So</span> <span m="4465820">we</span> <span m="4465920">start</span> <span m="4466220">with</span> <span m="4466300">the</span> <span m="4466380">base</span> <span m="4466760">case.</span> <span m="4468210">And</span> <span m="4468230">we</span> <span m="4468320">can</span> <span m="4468450">immediately</span> <span m="4468780">see</span> <span m="4469000">that</span> <span m="4469180">after</span> <span m="4469440">0</span> <span m="4469810">steps</span> <span m="4472360">in</span> <span m="4472490">the</span> <span m="4472860">Euclidean</span> <span m="4473220">algorithm,</span> <span m="4473820">I've</span> <span m="4474040">done</span> <span m="4474250">absolutely</span> <span m="4474730">nothing.</span> <span m="4475530">So</span> <span m="4476950">obviously</span> <span m="4480150">after</span> <span m="4480220">0</span> <span m="4480560">steps,</span> <span m="4481130">x</span> <span m="4481420">equals</span> <span m="4481840">a.</span> <span m="4482890">y</span> <span m="4483230">equals</span> <span m="4483660">b.</span> <span m="4484200">So</span> <span m="4484400">of</span> <span m="4484560">course,</span> <span m="4485400">they</span> <span m="4485550">are</span> <span m="4485650">linear</span> <span m="4485920">combinations</span> <span m="4486520">of a</span> <span m="4486670">and</span> <span m="4486920">b.</span> <span m="4488060">And</span> <span m="4489000">this</span> <span m="4489810">equality</span> <span m="4490360">holds,</span> <span m="4490660">as</span> <span m="4490790">well.</span> <span m="4491440">So</span> <span m="4491790">for</span> <span m="4491940">the base</span> <span m="4492400">case--</span> </p>
<p></p>
<p><span m="4498130">So</span> <span m="4498320">after</span> <span m="4498620">0</span> <span m="4498950">steps,</span> <span m="4500400">we</span> <span m="4500550">immediately know</span> <span m="4501160">that</span> <span m="4501280">p</span> <span m="4501500">0</span> <span m="4502090">is</span> <span m="4502290">true.</span> <span m="4504790">Now</span> <span m="4504940">for</span> <span m="4505040">the</span> <span m="4505310">inductive</span> <span m="4505670">step,</span> <span m="4507560">we</span> <span m="4507660">have</span> <span m="4507820">to</span> <span m="4507900">do</span> <span m="4508070">a</span> <span m="4508090">little</span> <span m="4508290">bit</span> <span m="4508430">more.</span> </p>
<p></p>
<p></p>
<p><span m="4517780">As</span> <span m="4518010">usual,</span> <span m="4518730">right?</span> <span m="4519025">We</span> <span m="4519320">always</span> <span m="4519740">assume</span> <span m="4522990">p</span> <span m="4523240">n.</span> <span m="4524410">And</span> <span m="4524600">now we</span> <span m="4524630">would</span> <span m="4524920">like</span> <span m="4525110">to</span> <span m="4525210">prove</span> <span m="4525620">p n</span> <span m="4526000">plus</span> <span m="4526240">1.</span> <span m="4527320">So</span> <span m="4527540">how</span> <span m="4527690">do</span> <span m="4527790">we</span> <span m="4527910">do</span> <span m="4528080">this?</span> <span m="4529572">Well,</span> <span m="4531360">we</span> <span m="4531580">notice</span> <span m="4537250">that</span> <span m="4537850">there</span> <span m="4538020">exists</span> <span m="4539140">a</span> <span m="4539240">q</span> <span m="4541140">such</span> <span m="4541510">that</span> <span m="4541700">the</span> <span m="4541900">remainder</span> <span m="4542190">of</span> <span m="4542690">y</span> <span m="4543520">and</span> <span m="4543750">x</span> <span m="4544790">is</span> <span m="4545070">equal</span> <span m="4545810">to</span> <span m="4546020">y</span> <span m="4546500">minus</span> <span m="4547030">q,</span> <span m="4547440">times</span> <span m="4547890">x.</span> <span m="4549730">So</span> <span m="4549960">we assume</span> <span m="4550500">p n.</span> <span m="4551270">We</span> <span m="4551420">have</span> <span m="4551640">reached</span> <span m="4551850">some</span> <span m="4552110">state,</span> <span m="4552530">x,</span> <span m="4552790">y.</span> <span m="4554470">We</span> <span m="4554610">know</span> <span m="4554770">that</span> <span m="4554950">the</span> <span m="4555030">remainder</span> <span m="4555540">of</span> <span m="4555730">y,</span> <span m="4555990">x</span> <span m="4556730">equals</span> <span m="4557100">y</span> <span m="4557310">minus</span> <span m="4557720">q,</span> <span m="4557910">times</span> <span m="4558350">x,</span> <span m="4558820">for</span> <span m="4558880">some</span> <span m="4559500">quotient</span> <span m="4560020">q.</span> <span m="4562830">We</span> <span m="4562960">know that</span> <span m="4563310">y is</span> <span m="4563800">a linear</span> <span m="4563950">combination</span> <span m="4564630">of</span> <span m="4566000">a and</span> <span m="4566350">b,</span> <span m="4566610">and</span> <span m="4566760">x is,</span> <span m="4567210">as</span> <span m="4567350">well.</span> <span m="4568610">So</span> <span m="4569330">that</span> <span m="4569530">means</span> <span m="4569870">that</span> <span m="4570090">this</span> <span m="4570360">one</span> <span m="4570660">is</span> <span m="4570840">actually</span> <span m="4571180">also</span> <span m="4572530">a</span> <span m="4572570">linear</span> <span m="4572980">combination</span> <span m="4575510">of</span> <span m="4575880">a and</span> <span m="4576820">b.</span> </p>
<p><span m="4578860">So</span> <span m="4579070">now</span> <span m="4579290">when</span> <span m="4579360">we look</span> <span m="4580270">at this</span> <span m="4580480">,</span> <span m="4580730">algorithm</span> <span m="4581540">we</span> <span m="4581680">can</span> <span m="4581850">see</span> <span m="4582770">that--</span> <span m="4585420">that</span> <span m="4585450">if</span> <span m="4585590">you</span> <span m="4585700">look</span> <span m="4585870">at</span> <span m="4585960">the</span> <span m="4586140">remainder</span> <span m="4586390">that</span> <span m="4586840">appears</span> <span m="4586990">in</span> <span m="4587410">here,</span> <span m="4588320">that's</span> <span m="4588540">still</span> <span m="4588860">a</span> <span m="4588920">linear</span> <span m="4589200">combination</span> <span m="4589800">of</span> <span m="4589940">a and</span> <span m="4590160">b.</span> <span m="4590850">So</span> <span m="4591520">after a</span> <span m="4591720">extra</span> <span m="4592150">step,</span> <span m="4593070">we</span> <span m="4593180">notice</span> <span m="4593720">that what</span> <span m="4594110">we</span> <span m="4594400">have</span> <span m="4594680">reached</span> <span m="4595420">are</span> <span m="4595600">still</span> <span m="4595920">in</span> <span m="4596150">combinations</span> <span m="4596740">of</span> <span m="4596870">a and</span> <span m="4597120">b.</span> <span m="4598170">And</span> <span m="4598340">of</span> <span m="4598490">course,</span> <span m="4599240">the</span> <span m="4599730">lemme</span> <span m="4599980">has</span> <span m="4600160">showed--</span> <span m="4600890">has</span> <span m="4601690">shown</span> <span m="4602040">us</span> <span m="4602670">that</span> <span m="4604330">what</span> <span m="4604500">we</span> <span m="4604680">reach</span> <span m="4605080">is</span> <span m="4605480">still</span> <span m="4606050">equal--</span> <span m="4606530">the</span> <span m="4606610">greatest</span> <span m="4606970">common divisor</span> <span m="4607380">is</span> <span m="4607510">still</span> <span m="4607770">equal</span> <span m="4608110">to</span> <span m="4608230">what</span> <span m="4608420">we</span> <span m="4608600">originally</span> <span m="4609100">started</span> <span m="4609480">out</span> <span m="4609720">with.</span> <span m="4611320">So</span> <span m="4611400">this</span> <span m="4611680">proves</span> <span m="4612510">p</span> <span m="4613350">of</span> <span m="4613570">n</span> <span m="4613800">plus 1.</span> </p>
<p></p>
<p><span m="4618800">So</span> <span m="4620130">n--</span> <span m="4620830">let's</span> <span m="4621000">finish</span> <span m="4621300">this</span> <span m="4621540">particular</span> <span m="4622020">proof.</span> <span m="4623380">So</span> <span m="4624680">for</span> <span m="4624870">the</span> <span m="4625070">very</span> <span m="4625700">last</span> <span m="4626360">step,</span> <span m="4626670">if</span> <span m="4626860">you</span> <span m="4626960">now</span> <span m="4627140">look</span> <span m="4627420">at</span> <span m="4627490">this</span> <span m="4627650">particular--</span> <span m="4632600">so</span> <span m="4632750">if</span> <span m="4632900">you</span> <span m="4632990">look</span> <span m="4633150">at</span> <span m="4633220">the</span> <span m="4633330">very</span> <span m="4633640">end,</span> <span m="4634470">we</span> <span m="4634650">notice</span> <span m="4634870">that</span> <span m="4635200">in</span> <span m="4635830">every</span> <span m="4636470">step</span> <span m="4636770">the</span> <span m="4636840">remainder</span> <span m="4637950">is</span> <span m="4638170">getting</span> <span m="4638620">smaller,</span> <span m="4639180">and</span> <span m="4639310">smaller,</span> <span m="4639750">and</span> <span m="4639880">smaller.</span> <span m="4640260">Right?</span> <span m="4642250">And</span> <span m="4642430">you</span> <span m="4642520">can</span> <span m="4642680">use</span> <span m="4642870">a</span> <span m="4642940">similar</span> <span m="4643320">kind</span> <span m="4643510">of</span> <span m="4643560">proof</span> <span m="4644200">technique</span> <span m="4644700">to</span> <span m="4644820">show</span> <span m="4645760">that</span> <span m="4646010">after</span> <span m="4646890">a</span> <span m="4647010">finite</span> <span m="4647390">number</span> <span m="4647540">of</span> <span m="4647880">steps,</span> <span m="4648510">we</span> <span m="4648640">will</span> <span m="4648830">reach</span> <span m="4649490">a GDP</span> <span m="4650760">of</span> <span m="4650900">0,</span> <span m="4651370">y.</span> <span m="4653190">Something</span> <span m="4653600">like</span> <span m="4653820">this.</span> </p>
<p><span m="4655200">So</span> <span m="4656140">in</span> <span m="4656280">the</span> <span m="4656480">very</span> <span m="4656790">last</span> <span m="4657390">step</span> <span m="4658830">of</span> <span m="4659060">Euclid's</span> <span m="4659510">algorithm</span> <span m="4661030">we</span> <span m="4661280">achieve</span> <span m="4662740">something</span> <span m="4663290">off</span> <span m="4663410">this</span> <span m="4663670">form.</span> <span m="4664890">We</span> <span m="4665020">now</span> <span m="4665230">use</span> <span m="4665700">our</span> <span m="4667210">predicate</span> <span m="4668010">over</span> <span m="4668080">here,</span> <span m="4669220">and</span> <span m="4669400">say</span> <span m="4669640">that</span> <span m="4669870">y</span> <span m="4670430">is</span> <span m="4670640">a</span> <span m="4670680">linear</span> <span m="4671030">combination</span> <span m="4671580">of</span> <span m="4671720">a and</span> <span m="4671930">b,</span> <span m="4673890">but</span> <span m="4674760">the</span> <span m="4674890">greatest</span> <span m="4675340">common</span> <span m="4675510">divisor</span> <span m="4676040">of</span> <span m="4676210">0, y</span> <span m="4677020">is</span> <span m="4677260">also</span> <span m="4677600">equal</span> <span m="4677920">to</span> <span m="4678040">the</span> <span m="4678160">original</span> <span m="4679120">greatest</span> <span m="4679380">common</span> <span m="4679420">divisor</span> <span m="4679900">that we</span> <span m="4680230">want</span> <span m="4680370">to</span> <span m="4680470">characterize.</span> </p>
<p><span m="4681860">So</span> <span m="4683510">now</span> <span m="4683820">we</span> <span m="4684000">have</span> <span m="4684270">proved</span> <span m="4684555">the</span> <span m="4684840">theorem</span> <span m="4685760">that</span> <span m="4685930">says</span> <span m="4686340">that</span> <span m="4686440">the</span> <span m="4686600">greatest</span> <span m="4686970">common</span> <span m="4687190">divisor</span> <span m="4687570">of a and</span> <span m="4687930">b is</span> <span m="4688290">actually</span> <span m="4688940">a</span> <span m="4688970">linear</span> <span m="4689320">combination.</span> <span m="4691830">So</span> <span m="4692000">now</span> <span m="4692290">we're</span> <span m="4692430">going</span> <span m="4692670">to</span> <span m="4692810">combine</span> <span m="4693240">all</span> <span m="4693430">those</span> <span m="4693600">three</span> <span m="4693840">theorems</span> <span m="4694840">in</span> <span m="4695040">one</span> <span m="4695260">go.</span> <span m="4696969">And</span> <span m="4699750">that</span> <span m="4699950">will</span> <span m="4700060">show</span> <span m="4700430">us</span> <span m="4703440">the</span> <span m="4703580">final</span> <span m="4704070">result,</span> <span m="4705580">which</span> <span m="4705860">is</span> <span m="4706180">that</span> <span m="4712440">the</span> <span m="4712550">theorem</span> <span m="4713050">that</span> <span m="4713350">the</span> <span m="4713440">greatest</span> <span m="4713930">common</span> <span m="4714150">divisor</span> <span m="4715230">of</span> <span m="4715560">a and</span> <span m="4716050">b</span> <span m="4716990">is</span> <span m="4717210">actually</span> <span m="4718560">the</span> <span m="4718690">smallest</span> <span m="4722010">positive</span> <span m="4726130">linear</span> <span m="4726540">combination</span> <span m="4729780">of</span> <span m="4730620">a and</span> <span m="4731380">b.</span> </p>
<p><span m="4734000">So</span> <span m="4734200">we're</span> <span m="4734320">going</span> <span m="4734600">to</span> <span m="4734840">combine</span> <span m="4735360">all</span> <span m="4735730">of</span> <span m="4735860">these</span> <span m="4736110">together.</span> <span m="4736840">We</span> <span m="4736940">know</span> <span m="4737120">that</span> <span m="4737320">the</span> <span m="4737400">greatest</span> <span m="4737840">common</span> <span m="4738080">divisor</span> <span m="4738810">divides</span> <span m="4739640">any</span> <span m="4740060">result.</span> <span m="4741970">The</span> <span m="4742320">theorem</span> <span m="4742450">up</span> <span m="4742690">there</span> <span m="4742970">says</span> <span m="4743440">that</span> <span m="4744090">any</span> <span m="4744355">linear</span> <span m="4744620">combination</span> <span m="4745160">can</span> <span m="4745330">be</span> <span m="4745480">reached.</span> <span m="4747160">And</span> <span m="4747550">also</span> <span m="4747960">just</span> <span m="4748430">showed--</span> <span m="4749170">have</span> <span m="4749430">shown</span> <span m="4749710">that</span> <span m="4749780">the</span> <span m="4749840">greatest</span> <span m="4750130">common</span> <span m="4750310">divisor</span> <span m="4750740">is</span> <span m="4750920">a</span> <span m="4750950">linear</span> <span m="4751220">combination</span> <span m="4752030">of</span> <span m="4752240">a and</span> <span m="4752410">b.</span> <span m="4753890">So</span> <span m="4754060">we</span> <span m="4754170">can</span> <span m="4754330">combine</span> <span m="4754730">those</span> <span m="4755040">three</span> <span m="4756320">to</span> <span m="4756440">get</span> <span m="4756630">this</span> <span m="4756720">theorem.</span> </p>
<p><span m="4757450">So</span> <span m="4757720">how</span> <span m="4757830">do</span> <span m="4757910">we</span> <span m="4758040">do</span> <span m="4758230">it?</span> <span m="4759120">Well,</span> <span m="4759290">let's</span> <span m="4759530">just</span> <span m="4759960">look</span> <span m="4760850">0</span> <span m="4762020">all</span> <span m="4762230">the</span> <span m="4762310">way</span> <span m="4762480">up</span> <span m="4762680">to</span> <span m="4762830">b.</span> <span m="4765620">Suppose</span> <span m="4766130">these</span> <span m="4766400">are</span> <span m="4766490">all</span> <span m="4766790">the</span> <span m="4766880">results</span> <span m="4769580">that</span> <span m="4769700">we</span> <span m="4769770">can</span> <span m="4769980">reach</span> <span m="4770380">in</span> <span m="4770630">our</span> <span m="4771630">problem.</span> <span m="4772530">We</span> <span m="4772640">know</span> <span m="4772810">that</span> <span m="4772980">the</span> <span m="4773060">greatest</span> <span m="4773510">common</span> <span m="4773760">divisor</span> <span m="4775300">divides</span> <span m="4776020">all</span> <span m="4776320">of</span> <span m="4776450">those.</span> <span m="4778160">At</span> <span m="4778260">the</span> <span m="4778280">same</span> <span m="4778640">time,</span> <span m="4778850">it's</span> <span m="4779000">also</span> <span m="4779250">linear</span> <span m="4779530">combination</span> <span m="4781390">that's</span> <span m="4781690">over here.</span> <span m="4782160">Since</span> <span m="4782380">it's</span> <span m="4782860">a linear</span> <span m="4782920">combination,</span> <span m="4783800">it</span> <span m="4783960">can</span> <span m="4784140">also</span> <span m="4784330">be</span> <span m="4784520">reached,</span> <span m="4784980">right?</span> <span m="4785860">By</span> <span m="4786130">the</span> <span m="4786760">theorem</span> <span m="4786950">that we</span> <span m="4787070">have.</span> <span m="4787840">So</span> <span m="4788040">suppose</span> <span m="4788490">that</span> <span m="4788600">this</span> <span m="4788790">is</span> <span m="4788910">the</span> <span m="4789000">greatest</span> <span m="4789400">common</span> <span m="4789630">divisor.</span> <span m="4791320">But</span> <span m="4791460">we</span> <span m="4791570">also</span> <span m="4791790">know</span> <span m="4792110">that the</span> <span m="4792180">greatest common</span> <span m="4792640">divisor</span> <span m="4793140">is</span> <span m="4793280">dividing</span> <span m="4794970">all</span> <span m="4795270">of</span> <span m="4795380">these</span> <span m="4795620">points</span> <span m="4796010">here</span> <span m="4796290">that can</span> <span m="4796460">be</span> <span m="4796600">reached.</span> <span m="4797760">So</span> <span m="4797850">therefore,</span> <span m="4798280">it</span> <span m="4798390">must</span> <span m="4798580">be</span> <span m="4798700">the</span> <span m="4798800">smallest</span> <span m="4799490">one.</span> </p>
<p><span m="4801420">And</span> <span m="4802200">I</span> <span m="4802300">will</span> <span m="4802440">leave</span> <span m="4802660">you</span> <span m="4802790">with</span> <span m="4802930">some</span> <span m="4803080">homework</span> <span m="4804050">to</span> <span m="4804220">think</span> <span m="4804490">about this</span> <span m="4804900">very</span> <span m="4805130">carefully.</span> <span m="4806210">And</span> <span m="4806860">you</span> <span m="4806970">can</span> <span m="4807120">show</span> <span m="4807400">for</span> <span m="4807580">yourself</span> <span m="4808190">that</span> <span m="4808230">you</span> <span m="4808320">can</span> <span m="4808480">now</span> <span m="4809220">combine</span> <span m="4809690">those</span> <span m="4810000">three</span> <span m="4810220">arguments</span> <span m="4810870">together,</span> <span m="4812170">and</span> <span m="4812390">see</span> <span m="4812660">that</span> <span m="4813140">the</span> <span m="4813280">greatest</span> <span m="4813670">common divisor</span> <span m="4814290">must</span> <span m="4814610">be</span> <span m="4814720">the</span> <span m="4814820">smallest</span> <span m="4815250">positive</span> <span m="4815630">linear</span> <span m="4815900">combination.</span> </p>
<p><span m="4818420">So,</span> <span m="4819390">I will</span> <span m="4819550">see</span> <span m="4819780">next</span> <span m="4820220">Thursday.</span> </p>
<p></p>
</div>
        <div id="vid_related" itemprop="description" class="tabContent hide">
<h2 class="subhead">Free Downloads</h2>
<h3 class="subsubhead">Video</h3>
<ul>
<li>iTunes U (<a href="http://itunes.apple.com/us/itunes-u/lecture-4-number-theory-i/id503873536?i=110644966">MP4 - 175MB</a>)</li>
<li>Internet Archive (<a href="http://www.archive.org/download/MIT6.042JF10/MIT6_042JF10_lec04_300k.mp4">MP4 - 175MB</a>)</li>
</ul>
<br>
<h3 class="subsubhead">Caption</h3>
<ul>
<li>English-US (<a href="../../../contents/video-lectures/lecture-4-number-theory-i/NuY7szYSXSw.srt">SRT</a>)</li>
</ul>
</div>
    
   </div>  




      					 
        <div class="" id="parent-fieldname-bottom_html_area">
            
            
        </div>
    
               </main><!--Course_inner_media tag close -->
           		</div>
<!--Course_wrapper tag close -->
            </div>
<!--left tag close -->
            <aside id="right">
                <!--Begin Right Portion -->
                    <div>
    



</div>

                	<div>
    



</div>


        <div class="" id="parent-fieldname-rsi_top_html_area">
            
            
        </div>
    

<!-- RSI google ad space-->



<div id="google_ads">    
    <script async="async" src="https://www.googletagservices.com/tag/js/gpt.js"></script>
    <script type="text/javascript">var googletag = googletag || {}; googletag.cmd = googletag.cmd || [];</script>
    <script type="text/javascript">
googletag.cmd.push(function() {googletag.defineSlot('/1064917/VIDEO_INDIVIDUAL_SLOT_A_DL', [[300, 250], [300, 300], [180, 200], [180, 150], [160, 600]], 'VIDEO_INDIVIDUAL_SLOT_A_DL').addService(googletag.pubads());googletag.defineSlot('/1064917/VIDEO_INDIVIDUAL_SLOT_B_DL', [[300, 250], [300, 300], [180, 200], [180, 150], [160, 600]], 'VIDEO_INDIVIDUAL_SLOT_B_DL').addService(googletag.pubads());googletag.defineSlot('/1064917/VIDEO_INDIVIDUAL_SLOT_C_DL', [[300, 250], [300, 300], [180, 200], [180, 150], [160, 600]], 'VIDEO_INDIVIDUAL_SLOT_C_DL').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
 googletag.enableServices();
});</script>
    <script language="javascript" type="text/javascript">
googletag.cmd.push(function() {googletag.pubads().set("TYPE","HOUSE");googletag.pubads().set("DEPARTMENT","6");googletag.pubads().set("CRS_BEG2","04");googletag.pubads().set("CRS_END","2J");googletag.pubads().set("SESSION","F");googletag.pubads().set("YEAR","10");})
</script>
    
    <div id="VIDEO_INDIVIDUAL_SLOT_A_DL">
    	<script>googletag.cmd.push(function() { googletag.display('VIDEO_INDIVIDUAL_SLOT_A_DL'); });</script>
    </div>
    <div id="VIDEO_INDIVIDUAL_SLOT_B_DL">
    	<script>googletag.cmd.push(function() { googletag.display('VIDEO_INDIVIDUAL_SLOT_B_DL'); });</script>
    </div>
    <div id="VIDEO_INDIVIDUAL_SLOT_C_DL">
    	<script>googletag.cmd.push(function() { googletag.display('VIDEO_INDIVIDUAL_SLOT_C_DL'); });</script>
    </div>
</div>

<!-- End RSI ads--> 


<div>
    



</div>

            </aside><!--Right div close -->
            <div class="clear"></div>
        </div>
<!--grid tag close -->
      </div>
		
		<footer id="bottom">
			<div id="grid">
				
<div id="portletwrapper-6f63772e626f74746f6d706f72746c65746d616e616765720a636f6e746578740a2f506c6f6e650a736974652d666f6f746572" class="portletWrapper kssattr-portlethash-6f63772e626f74746f6d706f72746c65746d616e616765720a636f6e746578740a2f506c6f6e650a736974652d666f6f746572">
<div class="portletStaticText portlet-static-site-footer"><div id="footer">
<nav aria-label="Footer">     <nav id="foot-c1" class="grid_2 alpha" aria-labelledby="f-find-courses">       <span class="footer" id="f-find-courses" aria-hidden="true">Find Courses</span>
<ul class="foot-bullet" role="presentation">
    <li><a href="https://ocw.mit.edu/courses/find-by-topic/">Find by Topic</a></li>
    <li><a href="https://ocw.mit.edu/courses/find-by-number/">Find by Course Number</a></li>
    <li><a href="https://ocw.mit.edu/courses/find-by-department/">Find by Department</a></li>
    <li><a href="https://ocw.mit.edu/courses/new-courses/">New Courses</a></li>
    <li><a href="https://ocw.mit.edu/courses/most-visited-courses/">Most Visited Courses</a></li>
    <li><a href="https://ocw.mit.edu/courses/ocw-scholar/">OCW Scholar Courses</a></li>
    <li><a href="https://ocw.mit.edu/courses/audio-video-courses/">Audio/Video Courses</a></li>
    <li><a href="https://ocw.mit.edu/courses/online-textbooks/">Online Textbooks</a></li>
    <li><a href="https://ocw.mit.edu/courses/instructor-insights/">Instructor Insights</a></li>
    <li><a href="https://ocw.mit.edu/resources/">Supplemental Resources</a></li>
    <li><a href="https://ocw.mit.edu/courses/mitx-related-courseware/">MITx &amp; Related OCW Courses</a></li>
    <li><a href="https://ocw.mit.edu/courses/mit-open-learning-library/">MIT Open Learning Library</a></li>
    <li><a href="https://ocw.mit.edu/courses/translated-courses/">Translated Courses</a></li>
</ul>
</nav>
<div id="foot-c2" class="grid_2"><nav aria-labelledby="f-for-educators">         <span id="f-for-educators" class="footer" aria-hidden="true">For Educators</span>
<ul class="foot-bullet" role="presentation">
    <li><a href="https://chalk-radio.simplecast.com/">Chalk Radio Podcast</a></li>
    <li><a href="https://ocw.mit.edu/educator/">OCW Educator Portal </a></li>
    <li><a href="https://ocw.mit.edu/courses/instructor-insights/">Instructor Insights by Department</a></li>
    <li><a href="https://openlearning.mit.edu/campus/digital-innovations/" aria-label="External Link: Residential Digital Innovations">Residential Digital Innovations </a></li>
    <li><a href="https://ocw.mit.edu/high-school/">OCW Highlights for High School</a></li>
    <li><a href="https://ocw.mit.edu/educator/additional-resources/">Additional Resources</a></li>
</ul>
</nav></div>
<nav class="grid_2" id="foot-c3" aria-labelledby="f-donate">       <span id="f-donate" class="footer" aria-hidden="true">Give Now</span>
<ul class="foot-bullet" role="presentation">
    <li><a href="https://ocw.mit.edu/give/">Make a Donation</a></li>
    <li><a href="https://ocw.mit.edu/give/why-give/">Why Give?</a></li>
    <li><a href="https://ocw.mit.edu/give/our-supporters/">Our Supporters</a></li>
    <li><a href="https://ocw.mit.edu/give/other-ways-to-contribute/">Other Ways to Contribute</a></li>
    <li><a href="https://ocw.mit.edu/support/">Become a Corporate Sponsor</a></li>
</ul>
</nav>
<div class="grid_2" id="foot-c4">
<nav aria-labelledby="f-about">         <span id="f-about" class="footer" aria-hidden="true">About</span>
<ul class="foot-bullet" role="presentation">
    <li><a href="https://ocw.mit.edu/about/">About OpenCourseWare</a></li>
    <li><a href="https://ocw.mit.edu/about/site-statistics/">Site Statistics</a></li>
    <li><a href="https://ocw.mit.edu/about/ocw-stories/">OCW Stories</a></li>
    <li><a href="https://ocw.mit.edu/about/newsletter/">Newsletter</a></li>
    <li><a href="https://www.ocw-openmatters.org/">Open Matters Blog</a></li>
</ul>
</nav><!--about-->       <nav aria-labelledby="f-tools">         <span id="f-tools" class="footer" aria-hidden="true">Tools</span>
<ul class="foot-bullet" role="presentation">
    <li><a href="https://ocw.mit.edu/help/">Help &amp; FAQs</a></li>
    <li><a href="https://ocw.mit.edu/about/contactus">Contact Us</a></li>
    <li><a href="https://accessibility.mit.edu/" target="_blank">Accessibility</a></li>
    <li><a href="https://ocw.mit.edu/help/site-map/">Site Map</a></li>
    <li><a href="../../../common/terms/index.htm">Privacy &amp; Terms of Use</a></li>
    <li><a href="https://ocw.mit.edu/help/rss/">RSS Feeds</a></li>
</ul>
</nav><!--tools-->
</div>
</nav> <aside style="min-height: 289px;" aria-labelledby="f-our-corporate-supporters" class="grid_4 omega" id="foot-c5">           <span aria-hidden="true" class="footer" id="f-our-corporate-supporters">Our Corporate Supporters</span>           <!-- HOME_CORP_LOGO_1 -->
<div id="div-gpt-ad-1388181177156-0" class="sponsors_google_ads_even"><script type="text/javascript">
              googletag.cmd.push(function() { googletag.display('div-gpt-ad-1388181177156-0'); });
            </script></div>
<!-- HOME_CORP_LOGO_2 -->
<div id="div-gpt-ad-1388181177156-1" class="sponsors_google_ads_odd"><script type="text/javascript">
              googletag.cmd.push(function() { googletag.display('div-gpt-ad-1388181177156-1'); });
            </script></div>
<!-- HOME_CORP_LOGO_3 -->
<div id="div-gpt-ad-1388181177156-2" class="sponsors_google_ads_even"><script type="text/javascript">
              googletag.cmd.push(function() { googletag.display('div-gpt-ad-1388181177156-2'); });
            </script></div>
<!-- HOME_CORP_LOGO_4 -->
<div id="div-gpt-ad-1388181177156-3" class="sponsors_google_ads_odd"><script type="text/javascript">
              googletag.cmd.push(function() { googletag.display('div-gpt-ad-1388181177156-3'); });
            </script></div>
<!-- HOME_CORP_LOGO_5 -->
<div id="div-gpt-ad-1388181177156-4" class="sponsors_google_ads_even"><script type="text/javascript">
              googletag.cmd.push(function() { googletag.display('div-gpt-ad-1388181177156-4'); });
              </script></div>
<!-- HOME_CORP_LOGO_6 -->
<div id="div-gpt-ad-1388181177156-5" class="sponsors_google_ads_odd"><script type="text/javascript">
              googletag.cmd.push(function() { googletag.display('div-gpt-ad-1388181177156-5'); });
              </script></div>
</aside>
<div class="grid_12 alpha omega" itemprop="publisher" itemscope="" itemtype="http://schema.org/CollegeOrUniversity">
<h4 class="footer" style="border-top: thin solid #d5c9ba; padding-top: 10px; margin-bottom: 10px;">About <span itemprop="name">MIT OpenCourseWare</span>
</h4>
<p style="color: #999; font-size: 1em; line-height: 1.5em; margin-top: 10px;" itemprop="description">MIT OpenCourseWare is an online publication of materials from over 2,500 MIT courses, freely sharing knowledge with learners and educators around the world. <a href="https://ocw.mit.edu/about/">Learn more »</a></p>
</div>
<div id="foot-copy" class="grid_12 alpha omega" style="border-top: none;">
<a href="http://web.mit.edu"><img src="../../../common/images/logo_mit.png" alt="Massachusetts Institute of Technology logo and name." style="width: 195; height: 44;"></a><a href="https://openlearning.mit.edu/"><img src="https://ocw.mit.edu/images/mitol_logo.png" alt="MIT Open Learning logo and name." style="width: 265; height: 50; vertical-align: top; padding-left:30px;"></a><a href="https://www.oeglobal.org/"><img src="https://ocw.mit.edu/images/oeg_logo.gif" alt="Open Education Consortium logo." style="width: 219px; height: 59px; vertical-align: top; padding-left:20px;"></a><a rel="license" itemprop="useRightsUrl" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img src="../../../common/images/cc_by-nc-sa.png" alt="Creative Commons logo with terms BY-NC-SA." style="width: 126px; height: 44px; margin-right: 0; padding-left: 20px;"></a>
<p class="copyright">© 2001–2018<br>
Massachusetts Institute of Technology</p>
<p style="font-size: 0.9em; margin-bottom: 15px;">Your use of the MIT OpenCourseWare site and materials is subject to our <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" rel="license">Creative Commons License</a> and other <a href="../../../common/terms/index.htm" rel="cc:morePermissions">terms of use</a>.</p>
</div>
</div></div>

</div>





                
			</div> <!-- bottom grid end -->
		</footer><!-- footer bottom end -->


   </body>
 </html>
